Index: src/game/WorldSocket.cpp =================================================================== --- src/game/WorldSocket.cpp (revision 5477) +++ src/game/WorldSocket.cpp (working copy) @@ -74,7 +74,10 @@ m_OverSpeedPings = 0; if (sWorld.getConfig(CONFIG_TCP_NO_DELAY)) - SetTcpNodelay(true); + { + SetTcpNodelay(false); + tcp_enabled=false; + } } /// WorldSocket destructor @@ -496,6 +499,25 @@ else m_OverSpeedPings = 0; + // If we have latency more than 250 (high) and disable Naglle - enable it. + if (sWorld.getConfig(CONFIG_TCP_NO_DELAY)) + { + if(latency >= 250) + { + if(!tcp_enabled) + { + SetTcpNodelay(true); + tcp_enabled=true; + } + } + // if Naggle enabled but latency is low - disable it + else if (tcp_enabled) + { + SetTcpNodelay(false); + tcp_enabled=false; + } + } + } ///- And put the pong answer in the to-be-sent queue Index: src/game/WorldSocket.h =================================================================== --- src/game/WorldSocket.h (revision 5477) +++ src/game/WorldSocket.h (working copy) @@ -166,6 +166,7 @@ uint32 m_LastPingMSTime; uint32 m_OverSpeedPings; + bool tcp_enabled; // internal checks void SizeError(WorldPacket const& packet, uint32 size) const;