From 59d7165f40d01b0df5d28a2654da844a9abcd2db Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Sun, 20 Jan 2008 21:11:55 +0000 Subject: Graceful failure of teleport to unavailable regions might actually work now. I blame all bugs on the age of my brain cells. --- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 78dca09..7cd77db 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -594,9 +594,7 @@ namespace OpenSim.Region.Communications.OGS1 //don't want to be creating a new link to the remote instance every time like we are here bool retValue = false; - checkRegion(regInfo.RemotingAddress, regInfo.RemotingPort); - if (Available) - { + OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( typeof(OGS1InterRegionRemoting), "tcp://" + regInfo.RemotingAddress + @@ -618,7 +616,7 @@ namespace OpenSim.Region.Communications.OGS1 retValue.ToString()); return retValue; - } + } return false; @@ -1091,18 +1089,18 @@ namespace OpenSim.Region.Communications.OGS1 // helper to see if remote region is up bool m_bAvailable = false; - int timeOut = 15000; //15 seconds + int timeOut = 10; //10 seconds - public void checkRegion(string address, uint port) + public void CheckRegion(string address, uint port) { + m_bAvailable = false; IPAddress ia = null; IPAddress.TryParse(address, out ia); IPEndPoint m_EndPoint = new IPEndPoint(ia, (int)port); AsyncCallback ConnectedMethodCallback = new AsyncCallback(ConnectedMethod); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IAsyncResult ar = socket.BeginConnect(m_EndPoint, ConnectedMethodCallback, socket); - ar.AsyncWaitHandle.WaitOne(timeOut, false); - socket.Close(); + ar.AsyncWaitHandle.WaitOne(timeOut*1000, false); } public bool Available -- cgit v1.1