change UDPPacketBuffer pools (does waste a bit of memory)

This commit is contained in:
UbitUmarov
2019-02-25 21:46:23 +00:00
parent 4dd89ce094
commit d01165818d
6 changed files with 157 additions and 324 deletions

View File

@@ -203,6 +203,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (ackedPacket != null)
{
m_packets.Remove(pendingAcknowledgement.SequenceNumber);
ackedPacket.Client.FreeUDPBuffer(ackedPacket.Buffer);
// As with other network applications, assume that an acknowledged packet is an
// indication that the network can handle a little more load, speed up the transmission
@@ -241,6 +242,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (removedPacket != null)
{
m_packets.Remove(pendingRemove);
removedPacket.Client.FreeUDPBuffer(removedPacket.Buffer);
// Update stats
Interlocked.Add(ref removedPacket.Client.UnackedBytes, -removedPacket.Buffer.DataLength);