mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Simple workaround to fix vcmiserver shutdown procedure
At the moment, vcmilobby *requires* async writes in order to handle multiple connections with different speeds and at optimal performance, without hanging if one player is too slow and can't eat all data server sent to him at once. However server (and potentially - client) can not handle this mode and may shutdown either socket or entire asio service too early, before all writes are performed, leading to weird freeze on ending scenario where client would not receive notifications about end of game.
This commit is contained in:
@@ -292,6 +292,7 @@ void LobbyServer::sendChatMessage(const NetworkConnectionPtr & target, const std
|
||||
|
||||
void LobbyServer::onNewConnection(const NetworkConnectionPtr & connection)
|
||||
{
|
||||
connection->setAsyncWritesEnabled(true);
|
||||
// no-op - waiting for incoming data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user