From 28fd58ce3fd4e0faa086f1457b46d9e19d607c08 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 21 Feb 2024 20:36:52 -0800 Subject: [PATCH] comments --- selfdrive/athena/athenad.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py index 833bf841f5..2eaf2b6f55 100755 --- a/selfdrive/athena/athenad.py +++ b/selfdrive/athena/athenad.py @@ -746,6 +746,9 @@ def ws_manage(ws: WebSocket, end_event: threading.Event) -> None: onroad_prev = onroad if sock is not None: + # While not sending data, onroad, we can expect to time out in 7 + (7 * 2) = 21s + # While sending data, offroad, we can expect to time out in 30 + (10 * 3) = 60s + # FIXME: TCP_USER_TIMEOUT is effectively 2x for some reason (32s) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, 16000 if onroad else 0) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 7 if onroad else 30) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 7 if onroad else 10)