* Attaches debug info to some DNS resolution code.

0.6.6-post-fixes
Adam Frisby 2009-05-25 06:46:41 +00:00
parent d4957dd9be
commit a38285f7f9
1 changed files with 16 additions and 8 deletions

View File

@ -134,18 +134,26 @@ namespace OpenSim.Framework
// Reset for next check // Reset for next check
ia = null; ia = null;
try
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{ {
if (ia == null) foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
ia = Adr;
if (Adr.AddressFamily == AddressFamily.InterNetwork)
{ {
ia = Adr; if (ia == null)
break; 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); return new IPEndPoint(ia, m_internalEndPoint.Port);
} }