mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Networking: Fixed Socket::DelayedCloseSocket not working if write queue is empty when its called on linux and mac
Closes #29887
This commit is contained in:
@@ -164,7 +164,14 @@ public:
|
||||
}
|
||||
|
||||
/// Marks the socket for closing after write buffer becomes empty
|
||||
void DelayedCloseSocket() { _closing = true; }
|
||||
void DelayedCloseSocket()
|
||||
{
|
||||
if (_closing.exchange(true))
|
||||
return;
|
||||
|
||||
if (_writeQueue.empty())
|
||||
CloseSocket();
|
||||
}
|
||||
|
||||
MessageBuffer& GetReadBuffer() { return _readBuffer; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user