diff --git a/protocol.c b/protocol.c index bee7430..972d221 100644 --- a/protocol.c +++ b/protocol.c @@ -1242,6 +1242,9 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) & buffer, 1); + if (receivedLength == -2) + continue; + if (receivedLength < 0) return -1; diff --git a/unix.c b/unix.c index e386626..c60090d 100644 --- a/unix.c +++ b/unix.c @@ -663,7 +663,7 @@ enet_socket_receive (ENetSocket socket, #ifdef HAS_MSGHDR_FLAGS if (msgHdr.msg_flags & MSG_TRUNC) - return -1; + return -2; #endif // Retrieve the local address that this traffic was received on diff --git a/win32.c b/win32.c index 257b509..ffdb220 100644 --- a/win32.c +++ b/win32.c @@ -534,13 +534,15 @@ enet_socket_receive (ENetSocket socket, case WSAEWOULDBLOCK: case WSAECONNRESET: return 0; + case WSAEMSGSIZE: + return -2; } return -1; } if (msg.dwFlags & MSG_PARTIAL) - return -1; + return -2; // Retrieve the local address that this traffic was received on // to ensure we respond from the correct address/interface.