mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 14:29:05 -07:00
don't throttle on first RTT measurement
This commit is contained in:
parent
bb14921419
commit
f89e5986d0
2 changed files with 4 additions and 3 deletions
|
@ -216,7 +216,7 @@ enum
|
|||
ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024,
|
||||
ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024,
|
||||
|
||||
ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 350,
|
||||
ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 500,
|
||||
ENET_PEER_DEFAULT_PACKET_THROTTLE = 32,
|
||||
ENET_PEER_PACKET_THROTTLE_SCALE = 32,
|
||||
ENET_PEER_PACKET_THROTTLE_COUNTER = 7,
|
||||
|
|
|
@ -854,12 +854,13 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer *
|
|||
roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime);
|
||||
roundTripTime = ENET_MAX (roundTripTime, 1);
|
||||
|
||||
enet_peer_throttle (peer, roundTripTime);
|
||||
|
||||
if (peer -> lastReceiveTime > 0)
|
||||
{
|
||||
enet_uint32 accumRoundTripTime = (peer -> roundTripTime << 8) + peer -> roundTripTimeRemainder;
|
||||
enet_uint32 accumRoundTripTimeVariance = (peer -> roundTripTimeVariance << 8) + peer -> roundTripTimeVarianceRemainder;
|
||||
|
||||
enet_peer_throttle (peer, roundTripTime);
|
||||
|
||||
roundTripTime <<= 8;
|
||||
if (roundTripTime >= accumRoundTripTime)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue