You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
Flushing delayed packets when shutting down NetPeer
This commit is contained in:
@@ -112,6 +112,18 @@ namespace Lidgren.Network
|
||||
}
|
||||
}
|
||||
|
||||
private void FlushDelayedPackets()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool connectionReset;
|
||||
foreach (DelayedPacket p in m_delayedPackets)
|
||||
ActuallySendPacket(p.Data, p.Data.Length, p.Target, out connectionReset);
|
||||
m_delayedPackets.Clear();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
internal bool ActuallySendPacket(byte[] data, int numBytes, IPEndPoint target, out bool connectionReset)
|
||||
{
|
||||
connectionReset = false;
|
||||
@@ -272,6 +284,10 @@ namespace Lidgren.Network
|
||||
return;
|
||||
}
|
||||
|
||||
private void FlushDelayedPackets()
|
||||
{
|
||||
}
|
||||
|
||||
private void SendCallBack(IAsyncResult res)
|
||||
{
|
||||
NetException.Assert(res.IsCompleted == true);
|
||||
|
||||
Reference in New Issue
Block a user