From a68ba01320c5161198aa52620edceb7539f129f4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 24 Sep 2019 21:42:41 +0200 Subject: [PATCH] handle socket timeouts --- owrx/websocket.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/owrx/websocket.py b/owrx/websocket.py index 71b0f38..257ba0e 100644 --- a/owrx/websocket.py +++ b/owrx/websocket.py @@ -160,6 +160,9 @@ class WebSocketConnection(object): logger.warning("unsupported opcode: {0}".format(opcode)) except IncompleteRead: available = False + except TimeoutError: + logger.warning("websocket timed out; closing connection") + self.open = False logger.debug("websocket loop ended; shutting down")