From 132833deeba81b74125987e2cfc1957f797ac2d4 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 14 May 2021 20:44:19 -0500 Subject: [PATCH] Limit RTO to 2x RTT and fix early peer timeout expiration --- enet | 2 +- src/ControlStream.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enet b/enet index 70ce1c3..c20ca39 160000 --- a/enet +++ b/enet @@ -1 +1 @@ -Subproject commit 70ce1c3e0b28ff8d475088a38c2a8560f064b22c +Subproject commit c20ca391e2e93abd275096f8c9423d5ba8aa05e8 diff --git a/src/ControlStream.c b/src/ControlStream.c index c010124..352ea69 100644 --- a/src/ControlStream.c +++ b/src/ControlStream.c @@ -1127,8 +1127,8 @@ int startControlStream(void) { // Ensure the connect verify ACK is sent immediately enet_host_flush(client); - // Set the max peer timeout to 10 seconds - enet_peer_timeout(peer, ENET_PEER_TIMEOUT_LIMIT, ENET_PEER_TIMEOUT_MINIMUM, 10000); + // Set the peer timeout to 10 seconds and limit backoff to 2x RTT + enet_peer_timeout(peer, 2, 10000, 10000); } else { ctlSock = connectTcpSocket(&RemoteAddr, RemoteAddrLen,