From 38eec06b4d068e1fb51a8b8b7b1e21673c335a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 31 Jul 2019 17:36:03 +0200 Subject: [PATCH] Move ZMQ bind address logging to TFWServer --- tfw/internals/networking/zmq_listener.py | 2 -- tfw/main/tfw_server.py | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tfw/internals/networking/zmq_listener.py b/tfw/internals/networking/zmq_listener.py index d43814a..2cf6b3d 100644 --- a/tfw/internals/networking/zmq_listener.py +++ b/tfw/internals/networking/zmq_listener.py @@ -18,7 +18,6 @@ class ZMQDownlinkListener: self._zmq_pull_socket.setsockopt(zmq.RCVHWM, 0) self._zmq_pull_socket.bind(bind_addr) self._zmq_pull_stream = ZMQStream(self._zmq_pull_socket) - LOG.debug('Pull socket bound to %s', bind_addr) def register_callback(self, callback): callback = with_deserialize_tfw_msg(callback) if callback else None @@ -42,7 +41,6 @@ class ZMQUplinkListener: self._zmq_pub_socket = zmq.Context.instance().socket(zmq.PUB) self._zmq_pub_socket.setsockopt(zmq.SNDHWM, 0) self._zmq_pub_socket.bind(bind_addr) - LOG.debug('Pub socket bound to %s', bind_addr) def send_message(self, message: dict): self._zmq_pub_socket.send_multipart(serialize_tfw_msg(message)) diff --git a/tfw/main/tfw_server.py b/tfw/main/tfw_server.py index 1706417..8c64a8e 100644 --- a/tfw/main/tfw_server.py +++ b/tfw/main/tfw_server.py @@ -16,10 +16,14 @@ class TFWServer: SUB socket. """ def __init__(self): + downlink_bind_addr = f'tcp://*:{TFWENV.PULL_PORT}' + uplink_bind_addr = f'tcp://*:{TFWENV.PUB_PORT}' self._listener = ZMQListener( - downlink_bind_addr=f'tcp://*:{TFWENV.PULL_PORT}', - uplink_bind_addr=f'tcp://*:{TFWENV.PUB_PORT}' + downlink_bind_addr=downlink_bind_addr, + uplink_bind_addr=uplink_bind_addr ) + LOG.debug('Pull socket bound to %s', downlink_bind_addr) + LOG.debug('Pub socket bound to %s', uplink_bind_addr) self.application = Application([( r'/ws', ZMQWebSocketRouter, { 'listener': self._listener,