You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 23:26:32 +09:00
m_needFlushSendQueue added to prevent traversing sender channels each heartbeat
This commit is contained in:
@@ -52,6 +52,7 @@ namespace Lidgren.Network
|
||||
internal override NetSendResult Enqueue(NetOutgoingMessage message)
|
||||
{
|
||||
m_queuedSends.Enqueue(message);
|
||||
m_connection.m_peer.m_needFlushSendQueue = true; // a race condition to this variable will simply result in a single superflous call to FlushSendQueue()
|
||||
if (m_queuedSends.Count <= GetAllowedSends())
|
||||
return NetSendResult.Sent;
|
||||
return NetSendResult.Queued;
|
||||
@@ -100,7 +101,7 @@ namespace Lidgren.Network
|
||||
return;
|
||||
|
||||
// queued sends
|
||||
while (m_queuedSends.Count > 0 && num > 0)
|
||||
while (num > 0 && m_queuedSends.Count > 0)
|
||||
{
|
||||
NetOutgoingMessage om;
|
||||
if (m_queuedSends.TryDequeue(out om))
|
||||
|
||||
Reference in New Issue
Block a user