1
0
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:
Ivan Savenko
2024-05-14 19:40:20 +00:00
parent da9d82b697
commit 35954dc41b
4 changed files with 30 additions and 8 deletions

View File

@@ -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
}