* Attaches debug info to some DNS resolution code.
parent
d4957dd9be
commit
a38285f7f9
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue