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:
@@ -26,6 +26,7 @@ namespace Lidgren.Network
|
||||
private double m_lastHeartbeat;
|
||||
private double m_lastSocketBind = float.MinValue;
|
||||
private NetUPnP m_upnp;
|
||||
internal bool m_needFlushSendQueue;
|
||||
|
||||
internal readonly NetPeerConfiguration m_configuration;
|
||||
private readonly NetQueue<NetIncomingMessage> m_releasedIncomingMessages;
|
||||
@@ -368,8 +369,11 @@ namespace Lidgren.Network
|
||||
#endif
|
||||
|
||||
// update m_executeFlushSendQueue
|
||||
if (m_configuration.m_autoFlushSendQueue)
|
||||
if (m_configuration.m_autoFlushSendQueue && m_needFlushSendQueue == true)
|
||||
{
|
||||
m_executeFlushSendQueue = true;
|
||||
m_needFlushSendQueue = false; // a race condition to this variable will simply result in a single superfluous call to FlushSendQueue()
|
||||
}
|
||||
|
||||
// do connection heartbeats
|
||||
lock (m_connections)
|
||||
|
||||
Reference in New Issue
Block a user