Cap the retransmit timer at 1/5 of the max peer timeout
This helps avoiding spurious disconnections in cases of large RTT variance
This commit is contained in:
@@ -1381,6 +1381,7 @@ enet_protocol_check_timeouts (ENetHost * host, ENetPeer * peer, ENetEvent * even
|
||||
++ peer -> packetsLost;
|
||||
|
||||
roundTripTimeout = peer -> roundTripTime + 4 * ENET_MAX (1, peer -> roundTripTimeVariance);
|
||||
roundTripTimeout = ENET_MIN (roundTripTimeout, peer->timeoutMaximum / 5);
|
||||
if (outgoingCommand -> sendAttempts < peer -> timeoutLimit)
|
||||
outgoingCommand -> roundTripTimeout = roundTripTimeout * ENET_MAX (1, outgoingCommand -> sendAttempts);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user