You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 07:06:30 +09:00
Recycle outgoing ping and mtu messages
This commit is contained in:
@@ -74,6 +74,7 @@ namespace Lidgren.Network
|
||||
m_peer.SendPacket(len, m_remoteEndPoint, 1, out connectionReset);
|
||||
|
||||
m_statistics.PacketSent(len, 1);
|
||||
m_peer.Recycle(om);
|
||||
}
|
||||
|
||||
internal void SendPong(int pingNumber)
|
||||
@@ -91,6 +92,7 @@ namespace Lidgren.Network
|
||||
m_peer.SendPacket(len, m_remoteEndPoint, 1, out connectionReset);
|
||||
|
||||
m_statistics.PacketSent(len, 1);
|
||||
m_peer.Recycle(om);
|
||||
}
|
||||
|
||||
internal void ReceivedPong(float now, int pongNumber, float remoteSendTime)
|
||||
|
||||
@@ -133,6 +133,7 @@ namespace Lidgren.Network
|
||||
m_lastSentMTUAttemptTime = now;
|
||||
|
||||
m_statistics.PacketSent(len, 1);
|
||||
m_peer.Recycle(om);
|
||||
}
|
||||
|
||||
private void FinalizeMTU(int size)
|
||||
@@ -154,6 +155,7 @@ namespace Lidgren.Network
|
||||
int len = om.Encode(m_peer.m_sendBuffer, 0, 0);
|
||||
bool connectionReset;
|
||||
m_peer.SendPacket(len, m_remoteEndPoint, 1, out connectionReset);
|
||||
m_peer.Recycle(om);
|
||||
|
||||
//m_peer.LogDebug("Received MTU expand request for " + size + " bytes");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user