mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
* 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
This commit is contained in:
@@ -121,20 +121,10 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Remove a client from the collection
|
||||
/// </summary>
|
||||
/// <param name="value">Reference to the client object</param>
|
||||
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)
|
||||
/// <param name="key">UUID of the client to remove</param>
|
||||
/// <returns>True if a client was removed, or false if the given UUID
|
||||
/// was not present in the collection</returns>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user