From e8c1e69a0dbab1a7db894eeff6b052bbd350a8f5 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Tue, 13 Oct 2009 18:56:54 -0700
Subject: * Copied LocklessQueue.cs into OpenSim.Framework and added the .Count
property and .Clear() method * Changed the way the QueueEmpty callback is
fired. It will be fired asynchronously as soon as an empty queue is detected
(this can happen immediately following a dequeue), and will not be fired
again until at least one packet is dequeued from that queue. This will give
callbacks advanced notice of an empty queue and prevent callbacks from
stacking up while the queue is empty * Added LLUDPClient.IsConnected checks
in several places to prevent unwanted network activity after a client
disconnects * Prevent LLClientView.Close() from being called twice every
disconnect * Removed the packet resend limit and improved the client timeout
check
---
OpenSim/Framework/ClientManager.cs | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Framework/ClientManager.cs')
diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs
index fd5f87f..367bc6a 100644
--- a/OpenSim/Framework/ClientManager.cs
+++ b/OpenSim/Framework/ClientManager.cs
@@ -121,20 +121,10 @@ namespace OpenSim.Framework
///
/// Remove a client from the collection
///
- /// Reference to the client object
- public void Remove(IClientAPI value)
- {
- lock (m_writeLock)
- {
- if (m_dict.ContainsKey(value.AgentId))
- m_dict = m_dict.Delete(value.AgentId);
-
- if (m_dict2.ContainsKey(value.RemoteEndPoint))
- m_dict2 = m_dict2.Delete(value.RemoteEndPoint);
- }
- }
-
- public void Remove(UUID key)
+ /// UUID of the client to remove
+ /// True if a client was removed, or false if the given UUID
+ /// was not present in the collection
+ public bool Remove(UUID key)
{
lock (m_writeLock)
{
@@ -144,6 +134,11 @@ namespace OpenSim.Framework
{
m_dict = m_dict.Delete(key);
m_dict2 = m_dict2.Delete(client.RemoteEndPoint);
+ return true;
+ }
+ else
+ {
+ return false;
}
}
}
--
cgit v1.1