From a39d3bb49ca4c203b966a77d6b4145746874071f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 6 Mar 2016 14:56:08 -0800 Subject: [PATCH] Wake up every once in a while to see if any retransmissions or pings need to be sent --- protocol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol.c b/protocol.c index fd62f8c..ecbb52f 100644 --- a/protocol.c +++ b/protocol.c @@ -1812,7 +1812,7 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout) timeout += host -> serviceTime; - do + for (;;) { if (ENET_TIME_DIFFERENCE (host -> serviceTime, host -> bandwidthThrottleEpoch) >= ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL) enet_host_bandwidth_throttle (host); @@ -1896,13 +1896,13 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout) waitCondition = ENET_SOCKET_WAIT_RECEIVE | ENET_SOCKET_WAIT_INTERRUPT; - if (enet_socket_wait (host -> socket, & waitCondition, ENET_TIME_DIFFERENCE (timeout, host -> serviceTime)) != 0) + if (enet_socket_wait (host -> socket, & waitCondition, ENET_TIME_DIFFERENCE (timeout, host -> serviceTime) / 10) != 0) return -1; } while (waitCondition & ENET_SOCKET_WAIT_INTERRUPT); host -> serviceTime = enet_time_get (); - } while (waitCondition & ENET_SOCKET_WAIT_RECEIVE); + } return 0; }