* 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.Sockets;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
|
@ -65,8 +66,15 @@ namespace OpenSim.Framework
|
||||||
return subnet.Key;
|
return subnet.Key;
|
||||||
}
|
}
|
||||||
|
|
||||||
// None found. Assume outside network.
|
// Check to see if we can find a IPv4 address.
|
||||||
return null;
|
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()
|
static NetworkUtil()
|
||||||
|
|
|
@ -31,7 +31,6 @@ using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Authentication;
|
|
||||||
using log4net;
|
using log4net;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
Loading…
Reference in New Issue