mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
windows: bump SO_SNDBUF size when playing with >4 players
This commit is contained in:
parent
abd3a0a130
commit
4ba30ebd9e
1 changed files with 11 additions and 0 deletions
|
@ -27,6 +27,17 @@ SOCKET socket_initialize(void) {
|
|||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
#if MAX_PLAYERS > 4
|
||||
// on windows, the send buffer for the socket needs to be increased
|
||||
// for the many players case to avoid WSAEWOULDBLOCK on send
|
||||
// not actually sure this is the "proper" way to fix it
|
||||
int bufsiz = 128 * 1024; // 128kb, default is apparently 8kb or 16kb
|
||||
rc = setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char *)&bufsiz, sizeof(bufsiz));
|
||||
if (rc != NO_ERROR) {
|
||||
LOG_ERROR("setsockopt(SO_SNDBUF) failed with error: %d", rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue