浏览代码

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.
Maxim 5 年之前
父节点
当前提交
33c7d6903e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      protocol.c

+ 1 - 1
protocol.c

@@ -1288,7 +1288,7 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event)
        }
     }
 
-    return -1;
+    return 0;
 }
 
 static void