aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 64e184d..ca48814 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -1567,12 +1567,13 @@ namespace OpenSim.Region.Communications.OGS1
1567 1567
1568 AsyncCallback callback = delegate(IAsyncResult iar) 1568 AsyncCallback callback = delegate(IAsyncResult iar)
1569 { 1569 {
1570 timed_out = false;
1571
1570 Socket s = (Socket)iar.AsyncState; 1572 Socket s = (Socket)iar.AsyncState;
1571 try 1573 try
1572 { 1574 {
1573 s.EndConnect(iar); 1575 s.EndConnect(iar);
1574 available = true; 1576 available = true;
1575 timed_out = false;
1576 } 1577 }
1577 catch (Exception e) 1578 catch (Exception e)
1578 { 1579 {
@@ -1583,10 +1584,12 @@ namespace OpenSim.Region.Communications.OGS1
1583 s.Close(); 1584 s.Close();
1584 }; 1585 };
1585 1586
1587 IAsyncResult ar;
1588
1586 try 1589 try
1587 { 1590 {
1588 Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); 1591 Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
1589 IAsyncResult ar = socket.BeginConnect(m_EndPoint, callback, socket); 1592 ar = socket.BeginConnect(m_EndPoint, callback, socket);
1590 ar.AsyncWaitHandle.WaitOne(timeOut * 1000, false); 1593 ar.AsyncWaitHandle.WaitOne(timeOut * 1000, false);
1591 } 1594 }
1592 catch (Exception e) 1595 catch (Exception e)
@@ -1596,9 +1599,11 @@ namespace OpenSim.Region.Communications.OGS1
1596 1599
1597 return false; 1600 return false;
1598 } 1601 }
1602
1603 ar.AsyncWaitHandle.Close();
1599 1604
1600 if (timed_out) 1605 if (timed_out)
1601 { 1606 {
1602 m_log.DebugFormat( 1607 m_log.DebugFormat(
1603 "[OGS1 GRID SERVICES]: socket [{0}] timed out ({1}) waiting to obtain a connection.", 1608 "[OGS1 GRID SERVICES]: socket [{0}] timed out ({1}) waiting to obtain a connection.",
1604 m_EndPoint, timeOut * 1000); 1609 m_EndPoint, timeOut * 1000);