From fb4eb05ae199dfdfb3ec379b5d273202597190d1 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 13 Aug 2008 21:45:17 +0000
Subject: * minor: make it clear on the console when a client is being logged
out because that client has not responded to pings
---
.../Region/ClientStack/LindenUDP/LLClientView.cs | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index c58b24b..12e5452 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -637,9 +637,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
# endregion
protected int m_terrainCheckerCount = 0;
+
///
/// Event handler for check client timer
- /// checks to ensure that the client is still connected
+ /// Checks to ensure that the client is still connected. If the client has failed to respond to many pings
+ /// in succession then close down the connection.
///
///
///
@@ -648,11 +650,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported)
{
m_probesWithNoIngressPackets++;
- if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked) || (m_probesWithNoIngressPackets > 90 && m_clientBlocked))
+ if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked)
+ || (m_probesWithNoIngressPackets > 90 && m_clientBlocked))
{
-
if (OnConnectionClosed != null)
{
+ m_log.WarnFormat(
+ "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection",
+ Name, AgentId);
+
OnConnectionClosed(this);
}
}
@@ -682,6 +688,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Establish our two timers. We could probably get this down to one
+ // Ping the client regularly to check that it's still there
m_clientPingTimer = new Timer(5000);
m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
m_clientPingTimer.Enabled = true;
@@ -3402,12 +3409,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
///
///
- ///
- /// A
- ///
- ///
- /// A
- ///
+ ///
+ ///
protected virtual bool Logout(IClientAPI client)
{
m_log.Info("[CLIENT]: Got a logout request");
--
cgit v1.1