diff --git a/lib/tfw/networking/server/event_handler_connector.py b/lib/tfw/networking/server/event_handler_connector.py index 8b13338..7b56a88 100644 --- a/lib/tfw/networking/server/event_handler_connector.py +++ b/lib/tfw/networking/server/event_handler_connector.py @@ -26,6 +26,9 @@ class EventHandlerDownlinkConnector(ZMQConnectorBase): callback = with_deserialize_tfw_msg(callback) self._zmq_pull_stream.on_recv(callback) + def close(self): + self._zmq_pull_stream.close() + class EventHandlerUplinkConnector(ZMQConnectorBase): def __init__(self, zmq_context=None): @@ -39,6 +42,11 @@ class EventHandlerUplinkConnector(ZMQConnectorBase): def send_message(self, message: dict): self._zmq_pub_socket.send_multipart(serialize_tfw_msg(message)) + def close(self): + self._zmq_pub_socket.close() + class EventHandlerConnector(EventHandlerDownlinkConnector, EventHandlerUplinkConnector): - pass + def close(self): + EventHandlerDownlinkConnector.close(self) + EventHandlerUplinkConnector.close(self)