a few changes on (HG)EntityTransfer plus a few use of ExpiringcacheOS

This commit is contained in:
UbitUmarov
2020-08-10 20:49:41 +01:00
parent 3043cfd5fb
commit e6acc57e0b
4 changed files with 110 additions and 59 deletions

View File

@@ -326,7 +326,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>Flag to signal when clients should send pings</summary>
protected bool m_sendPing;
protected ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCache<IPEndPoint, Queue<UDPPacketBuffer>>();
protected ExpiringCacheOS<IPEndPoint, Queue<UDPPacketBuffer>> m_pendingCache = new ExpiringCacheOS<IPEndPoint, Queue<UDPPacketBuffer>>(10000);
protected int m_defaultRTO = 0;
protected int m_maxRTO = 0;
@@ -1338,8 +1338,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// If this is a pending connection, enqueue, don't process yet
lock (m_pendingCache)
{
Queue<UDPPacketBuffer> queue;
if (m_pendingCache.TryGetValue(endPoint, out queue))
if (m_pendingCache.TryGetValue(endPoint, out Queue<UDPPacketBuffer> queue))
{
//m_log.DebugFormat("[LLUDPSERVER]: Enqueued a {0} packet into the pending queue", packet.Type);
queue.Enqueue(buffer);
@@ -1654,12 +1653,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
}
// Now we know we can handle more data
//Thread.Sleep(200);
// Obtain the pending queue and remove it from the cache
Queue<UDPPacketBuffer> queue = null;
lock (m_pendingCache)
{
if (!m_pendingCache.TryGetValue(endPoint, out queue))