From 0df5286c0e2861b4c1b73a70849065b138991a90 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 19 Jun 2022 15:41:43 +0200 Subject: [PATCH] Ignore if socket is blocking --- mitel_ommclient2/connection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mitel_ommclient2/connection.py b/mitel_ommclient2/connection.py index e26bc72..482bb85 100644 --- a/mitel_ommclient2/connection.py +++ b/mitel_ommclient2/connection.py @@ -55,8 +55,11 @@ class Connection: if select.select([self._socket], [], []) != ([], [], []): # wait for data availiable while True: - # fill buffer with one message - data = self._socket.recv(1024) + try: + # fill buffer with one message + data = self._socket.recv(1024) + except BlockingIOError: + continue if not data: # buffer is empty