aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2020-04-13 19:32:13 -0400
committerLee Salzman <[email protected]>2020-04-13 19:32:13 -0400
commitf89e5986d06033f6b6421163444960f78dec99f8 (patch)
tree28ffaf859306338d51f06e921429d64bb25a34fc
parentbb1492141950ea4fd95b0a810054f6207e90e6c8 (diff)
downloadenet-f89e5986d06033f6b6421163444960f78dec99f8.tar.gz
enet-f89e5986d06033f6b6421163444960f78dec99f8.zip
don't throttle on first RTT measurement
-rw-r--r--include/enet/enet.h2
-rw-r--r--protocol.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/include/enet/enet.h b/include/enet/enet.h
index 174e062..baea93a 100644
--- a/include/enet/enet.h
+++ b/include/enet/enet.h
@@ -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,
diff --git a/protocol.c b/protocol.c
index a1d7ee1..163ebca 100644
--- a/protocol.c
+++ b/protocol.c
@@ -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)
{