From c12e7bab90e81f474781fb816a4d92b342969c2c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 25 Sep 2020 17:28:25 +0200 Subject: [PATCH] The streaming thread shouldn't fail and exit if it fails closing a client socket --- platypush/plugins/camera/pi/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/camera/pi/__init__.py b/platypush/plugins/camera/pi/__init__.py index 82be09be24..a397a38087 100644 --- a/platypush/plugins/camera/pi/__init__.py +++ b/platypush/plugins/camera/pi/__init__.py @@ -155,7 +155,10 @@ class CameraPiPlugin(CameraPlugin): self.logger.info('Client closed connection') finally: if sock: - sock.close() + try: + sock.close() + except Exception as e: + self.logger.warning('Error while closing client socket: {}'.format(str(e))) finally: self._cleanup_stream(camera, server_socket, sock) try: