Fix client disconnect from leftover socket recv timeout

Clear the 5-second SO_RCVTIMEO that was set during the connection
handshake but never removed. The timeout persisted into the game
session, causing the client to disconnect whenever the server paused
for longer than 5 seconds (e.g. autosave, chunk I/O).

Also update README with chunk unloading and connection stability fixes.
This commit is contained in:
itsRevela
2026-03-25 23:54:52 -05:00
parent c264262b66
commit 6d28177e4c
3 changed files with 13 additions and 0 deletions
@@ -455,6 +455,12 @@ bool WinsockNetLayer::JoinGame(const char* ip, int port)
{
return false;
}
// Clear the recv timeout now that the handshake is complete.
// The recv thread should block indefinitely waiting for data.
DWORD noTimeout = 0;
setsockopt(s_hostConnectionSocket, SOL_SOCKET, SO_RCVTIMEO, (const char*)&noTimeout, sizeof(noTimeout));
s_localSmallId = assignedSmallId;
// Save the host IP and port so JoinSplitScreen can connect to the same host