GameNetworkingSockets icon indicating copy to clipboard operation
GameNetworkingSockets copied to clipboard

Fix incorrect control buffer length when filling `WSAMSG` for `WSARecvMsg`

Open ManManson opened this issue 8 months ago • 0 comments

Somehow, this bug causes problems with listen sockets on Windows 11 platform.

After some number of client connections being abruptly terminated (e.g. client has crashed), the host just stops to invoke connection state change callbacks for the still opened listen socket.

In this particular case, WSARecvMsg always returns -1 (SOCKET_ERROR) and WSAGetLastError() returns 10014 (WSAEFAULT), which indicates there's a problem with function arguments.

So, it seems, that in some cases Windows will try to use the control data, but if there's been some problem with it, the connection will just remain in the broken state forever.

ManManson avatar May 13 '25 21:05 ManManson