From e044d83679757473204dabb37002024f70b5ff6b Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 3 Sep 2008 03:35:54 +0000 Subject: Mantis#2106. Thank you kindly, HomerHorwitz for a patch that: The attached patch fixes connectivety checking of root- and child-agents. If an agent's client isn't sending any packets for some time (not even to StartPingCheck packets), we assume that we lost connection and try to log them out. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 663344e..6e37e0c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -94,6 +94,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool m_SendLogoutPacketWhenClosing = true; + private int m_inPacketsChecked = 0; + /* protected variables */ protected static Dictionary PacketHandlers = @@ -670,11 +672,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// protected void CheckClientConnectivity(object sender, ElapsedEventArgs e) { - if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported) + if (m_PacketHandler.PacketsReceived == m_inPacketsChecked) { + // no packet came in since the last time we checked... + m_probesWithNoIngressPackets++; - if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) - || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) + if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) // agent active + || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) // agent paused { m_clientPingTimer.Enabled = false; @@ -697,6 +701,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Something received in the meantime - we can reset the counters m_probesWithNoIngressPackets = 0; + // ... and store the current number of packets received to find out if another one got in on the next cycle + m_inPacketsChecked = m_PacketHandler.PacketsReceived; } } -- cgit v1.1