diff options
author | Adam Frisby | 2009-05-23 05:18:37 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-23 05:18:37 +0000 |
commit | f8c569dc7c825d7ee8bf0fcbc225e3ec0f379862 (patch) | |
tree | c36fc07b3d796f32fdd43c0cdd41d714419400ef | |
parent | * Adds new NetworkUtil class, contains methods for handling IP resolution whe... (diff) | |
download | opensim-SC_OLD-f8c569dc7c825d7ee8bf0fcbc225e3ec0f379862.zip opensim-SC_OLD-f8c569dc7c825d7ee8bf0fcbc225e3ec0f379862.tar.gz opensim-SC_OLD-f8c569dc7c825d7ee8bf0fcbc225e3ec0f379862.tar.bz2 opensim-SC_OLD-f8c569dc7c825d7ee8bf0fcbc225e3ec0f379862.tar.xz |
* NetworkUtil now handles an error case in a way which is easier to debug.
-rw-r--r-- | OpenSim/Framework/NetworkUtil.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 1abf0d8..759c52f 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs | |||
@@ -1,4 +1,5 @@ | |||
1 | using System.Collections.Generic; | 1 | using System; |
2 | using System.Collections.Generic; | ||
2 | using System.Net.Sockets; | 3 | using System.Net.Sockets; |
3 | using System.Net; | 4 | using System.Net; |
4 | using System.Net.NetworkInformation; | 5 | using System.Net.NetworkInformation; |
@@ -65,8 +66,15 @@ namespace OpenSim.Framework | |||
65 | return subnet.Key; | 66 | return subnet.Key; |
66 | } | 67 | } |
67 | 68 | ||
68 | // None found. Assume outside network. | 69 | // Check to see if we can find a IPv4 address. |
69 | return null; | 70 | foreach (IPAddress host in Dns.GetHostAddresses(defaultHostname)) |
71 | { | ||
72 | if (host.AddressFamily == AddressFamily.InterNetwork) | ||
73 | return host; | ||
74 | } | ||
75 | |||
76 | // Unable to find anything. | ||
77 | throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); | ||
70 | } | 78 | } |
71 | 79 | ||
72 | static NetworkUtil() | 80 | static NetworkUtil() |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 3067d75..684d42b 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -31,7 +31,6 @@ using System.Collections.Generic; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Net.Sockets; | 32 | using System.Net.Sockets; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Security.Authentication; | ||
35 | using log4net; | 34 | using log4net; |
36 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
37 | using OpenMetaverse; | 36 | using OpenMetaverse; |