diff --git a/src/UDPConnection.c b/src/UDPConnection.c index 609cddc..50b61f8 100644 --- a/src/UDPConnection.c +++ b/src/UDPConnection.c @@ -4,6 +4,7 @@ #include #include #include +#include UDPC_Context* UDPC_init(uint16_t listenPort, int isClient) { @@ -460,6 +461,13 @@ void UDPC_update(UDPC_Context *ctx) 0, (struct sockaddr*) &receivedData, &receivedDataSize); + + if(bytes == 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) + { + // expected result for non-blocking socket + return; + } + if(bytes < 20) { UDPC_INTERNAL_log(ctx, 2, "Got invalid packet from %s port %d (too small)",