Wake up every once in a while to see if any retransmissions or pings need to be sent

This commit is contained in:
Cameron Gutman
2016-03-06 14:56:08 -08:00
parent ae9002fe19
commit a39d3bb49c
+3 -3
View File
@@ -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;
}