diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 8068ff5..ead5d3c 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -462,50 +462,7 @@ namespace OpenSim.Services.Interfaces | |||
462 | /// </value> | 462 | /// </value> |
463 | public IPEndPoint ExternalEndPoint | 463 | public IPEndPoint ExternalEndPoint |
464 | { | 464 | { |
465 | get | 465 | get { return Util.getEndPoint(m_externalHostName, m_internalEndPoint.Port); } |
466 | { | ||
467 | IPAddress ia = null; | ||
468 | // If it is already an IP, don't resolve it - just return directly | ||
469 | // we should not need this | ||
470 | if (IPAddress.TryParse(m_externalHostName, out ia)) | ||
471 | { | ||
472 | if (ia.Equals(IPAddress.Any) || ia.Equals(IPAddress.IPv6Any)) | ||
473 | return null; | ||
474 | return new IPEndPoint(ia, m_internalEndPoint.Port); | ||
475 | } | ||
476 | |||
477 | // Reset for next check | ||
478 | ia = null; | ||
479 | try | ||
480 | { | ||
481 | foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) | ||
482 | { | ||
483 | if (ia == null) | ||
484 | ia = Adr; | ||
485 | |||
486 | if (Adr.AddressFamily == AddressFamily.InterNetwork) | ||
487 | { | ||
488 | ia = Adr; | ||
489 | break; | ||
490 | } | ||
491 | } | ||
492 | } | ||
493 | catch // (SocketException e) | ||
494 | { | ||
495 | /*throw new Exception( | ||
496 | "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + | ||
497 | e + "' attached to this exception", e);*/ | ||
498 | // Don't throw a fatal exception here, instead, return Null and handle it in the caller. | ||
499 | // Reason is, on systems such as OSgrid it has occured that known hostnames stop | ||
500 | // resolving and thus make surrounding regions crash out with this exception. | ||
501 | return null; | ||
502 | } | ||
503 | |||
504 | if(ia == null) | ||
505 | return null; | ||
506 | |||
507 | return new IPEndPoint(ia, m_internalEndPoint.Port); | ||
508 | } | ||
509 | } | 466 | } |
510 | 467 | ||
511 | public string ExternalHostName | 468 | public string ExternalHostName |