diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 9ec7326..367db61 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -134,18 +134,26 @@ namespace OpenSim.Framework | |||
134 | 134 | ||
135 | // Reset for next check | 135 | // Reset for next check |
136 | ia = null; | 136 | ia = null; |
137 | 137 | try | |
138 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | ||
139 | { | 138 | { |
140 | if (ia == null) | 139 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) |
141 | ia = Adr; | ||
142 | |||
143 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
144 | { | 140 | { |
145 | ia = Adr; | 141 | if (ia == null) |
146 | break; | 142 | ia = Adr; |
143 | |||
144 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
145 | { | ||
146 | ia = Adr; | ||
147 | break; | ||
148 | } | ||
147 | } | 149 | } |
148 | } | 150 | } |
151 | catch (SocketException e) | ||
152 | { | ||
153 | throw new Exception( | ||
154 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + | ||
155 | e + "' attached to this exception", e); | ||
156 | } | ||
149 | 157 | ||
150 | return new IPEndPoint(ia, m_internalEndPoint.Port); | 158 | return new IPEndPoint(ia, m_internalEndPoint.Port); |
151 | } | 159 | } |