From f8ca656ff043ca1aca2b083518f5befefccf213e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Mon, 29 Jan 2018 18:03:54 +0100 Subject: [PATCH] Fix ZMQWebSocketHandler's sockets being bound several times --- src/app/handlers/zmq_websocket_handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/handlers/zmq_websocket_handler.py b/src/app/handlers/zmq_websocket_handler.py index 1c0fb4a..1542280 100644 --- a/src/app/handlers/zmq_websocket_handler.py +++ b/src/app/handlers/zmq_websocket_handler.py @@ -7,9 +7,10 @@ from event_handler_connector import EventHandlerConnector class ZMQWebSocketHandler(WebSocketHandler): - def __init__(self, application, request, **kwargs): + _event_handler_connector = EventHandlerConnector() #<--------------------. TODO: how is __init__() + # fix: made it static | TODO: called more than once? + def __init__(self, application, request, **kwargs): #---------------------' super().__init__(application, request, **kwargs) - self._event_handler_connector = EventHandlerConnector() def open(self, *args, **kwargs): logging.debug('WebSocket connection initiated')