mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
* NetworkUtil now handles an error case in a way which is easier to debug.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user