Browse Source

Added ConnectionResetError exception handling while sending response

master
Dirk Alders 2 months ago
parent
commit
ffe6b2bf3b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      __init__.py

+ 1
- 1
__init__.py View File

@@ -248,7 +248,7 @@ class tcp_base(object):
248 248
                     self.__connection__.sendall(data)
249 249
                 except BlockingIOError:
250 250
                     time.sleep(.1)  # try again till timeout exceeds
251
-                except BrokenPipeError:
251
+                except (BrokenPipeError, ConnectionResetError) as e:
252 252
                     self.logger.exception('%s Exception while sending data', self.__log_prefix__())
253 253
                     self.__connection_lost__()
254 254
                     return False

Loading…
Cancel
Save