From 64ea7d8218523779c64e66d7a55e6017ea22c790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Mon, 8 Jul 2019 20:12:12 +0200 Subject: [PATCH] Fix ZMQ socketopt call order --- lib/tfw/networking/server_connector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tfw/networking/server_connector.py b/lib/tfw/networking/server_connector.py index e1ef1fe..88e9450 100644 --- a/lib/tfw/networking/server_connector.py +++ b/lib/tfw/networking/server_connector.py @@ -13,8 +13,8 @@ LOG = logging.getLogger(__name__) class ServerDownlinkConnector(): def __init__(self, connect_addr): self._zmq_sub_socket = zmq.Context.instance().socket(zmq.SUB) - self._zmq_sub_socket.connect(connect_addr) self._zmq_sub_socket.setsockopt(zmq.RCVHWM, 0) + self._zmq_sub_socket.connect(connect_addr) self._zmq_sub_stream = ZMQStream(self._zmq_sub_socket) self.subscribe = partial(self._zmq_sub_socket.setsockopt_string, zmq.SUBSCRIBE) @@ -31,8 +31,8 @@ class ServerDownlinkConnector(): class ServerUplinkConnector(): def __init__(self, connect_addr): self._zmq_push_socket = zmq.Context.instance().socket(zmq.PUSH) - self._zmq_push_socket.connect(connect_addr) self._zmq_push_socket.setsockopt(zmq.SNDHWM, 0) + self._zmq_push_socket.connect(connect_addr) def send_message(self, message, scope=Scope.ZMQ): message['scope'] = scope.value