* NetworkUtil now handles an error case in a way which is easier to debug.
parent
2d06135166
commit
f8c569dc7c
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
|
@ -65,8 +66,15 @@ namespace OpenSim.Framework
|
|||
return subnet.Key;
|
||||
}
|
||||
|
||||
// None found. Assume outside network.
|
||||
return null;
|
||||
// Check to see if we can find a IPv4 address.
|
||||
foreach (IPAddress host in Dns.GetHostAddresses(defaultHostname))
|
||||
{
|
||||
if (host.AddressFamily == AddressFamily.InterNetwork)
|
||||
return host;
|
||||
}
|
||||
|
||||
// Unable to find anything.
|
||||
throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client");
|
||||
}
|
||||
|
||||
static NetworkUtil()
|
||||
|
|
|
@ -31,7 +31,6 @@ using System.Collections.Generic;
|
|||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Security.Authentication;
|
||||
using log4net;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenMetaverse;
|
||||
|
|
Loading…
Reference in New Issue