From ffe6b2bf3ba5829361349ff318cb721cb6f42266 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Wed, 21 Aug 2024 20:53:02 +0200 Subject: [PATCH] Added ConnectionResetError exception handling while sending response --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index e96b7f4..fcf6511 100644 --- a/__init__.py +++ b/__init__.py @@ -248,7 +248,7 @@ class tcp_base(object): self.__connection__.sendall(data) except BlockingIOError: time.sleep(.1) # try again till timeout exceeds - except BrokenPipeError: + except (BrokenPipeError, ConnectionResetError) as e: self.logger.exception('%s Exception while sending data', self.__log_prefix__()) self.__connection_lost__() return False