From 7892aac4deb927145252b5dcc401e9c2b1d8f71b Mon Sep 17 00:00:00 2001 From: Chris Lajoie Date: Wed, 20 May 2020 03:56:27 -0600 Subject: [PATCH] Continue reading from socket if no data received (#70) Without this change, `modeslive` crashes if no data is available on the socket, which can happen during normal operation of a receiver if no aircraft are in range. Tested on Python 3.7 --- pyModeS/extra/tcpclient.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyModeS/extra/tcpclient.py b/pyModeS/extra/tcpclient.py index 0f18c54..26be3be 100644 --- a/pyModeS/extra/tcpclient.py +++ b/pyModeS/extra/tcpclient.py @@ -282,6 +282,8 @@ class TcpClient(object): # raise RuntimeError("test exception") + except zmq.error.Again: + continue except Exception as e: tb = traceback.format_exc() exception_queue.put(tb)