From a38285f7f9145fcacbfc27a5683d8463c095492e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 25 May 2009 06:46:41 +0000 Subject: * Attaches debug info to some DNS resolution code. --- OpenSim/Framework/RegionInfo.cs | 24 ++++++++++++++++-------- 1 file 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 // Reset for next check ia = null; - - foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) + try { - if (ia == null) - ia = Adr; - - if (Adr.AddressFamily == AddressFamily.InterNetwork) + foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) { - ia = Adr; - break; + if (ia == null) + ia = Adr; + + if (Adr.AddressFamily == AddressFamily.InterNetwork) + { + ia = Adr; + break; + } } } + catch (SocketException e) + { + throw new Exception( + "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + + e + "' attached to this exception", e); + } return new IPEndPoint(ia, m_internalEndPoint.Port); } -- cgit v1.1