From 33c7d6903e843d450eb18769d5802e83de538825 Mon Sep 17 00:00:00 2001 From: Maxim <46995666+Vincenz099@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:58:08 +0200 Subject: [PATCH] Return 0 instead of -1 on enet_protocol_receive_incoming_commands Return 0 instead of -1 on enet_protocol_receive_incoming_commands when nothing received. This allows the Service loop to continue running and not return an error when there is nothing to do with the socket receive. From debugging I found sometimes the enet_protocol_receive_incoming_commands returns -1 because simply nothing happened in the 256 for loop. Other functions like enet_protocol_send_outgoing_commands return 0 when nothing happened. --- protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.c b/protocol.c index 98ee51e..a1d7ee1 100644 --- a/protocol.c +++ b/protocol.c @@ -1288,7 +1288,7 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) } } - return -1; + return 0; } static void