From f151ecfbac378187856c0d3c0af6fb835dd30933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Mon, 27 May 2019 20:11:03 +0200 Subject: [PATCH] Improve ZMQ port envvar names --- Dockerfile | 4 ++-- lib/tfw/networking/event_handler_connector.py | 4 ++-- lib/tfw/networking/server_connector.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 22237e8..94eee57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ ENV TFW_PUBLIC_PORT=8888 \ TFW_LOGIN_APP_PORT=6666 \ TFW_TERMINADO_PORT=7878 \ TFW_SUPERVISOR_HTTP_PORT=9001 \ - TFW_PUBLISHER_PORT=7654 \ - TFW_RECEIVER_PORT=8765 + TFW_PUB_PORT=7654 \ + TFW_PULL_PORT=8765 EXPOSE ${TFW_PUBLIC_PORT} diff --git a/lib/tfw/networking/event_handler_connector.py b/lib/tfw/networking/event_handler_connector.py index 03f2513..bf2c9ae 100644 --- a/lib/tfw/networking/event_handler_connector.py +++ b/lib/tfw/networking/event_handler_connector.py @@ -17,7 +17,7 @@ class EventHandlerDownlinkConnector(): self._zmq_pull_socket = zmq.Context.instance().socket(zmq.PULL) self._zmq_pull_socket.setsockopt(zmq.RCVHWM, 0) self._zmq_pull_stream = ZMQStream(self._zmq_pull_socket) - address = f'tcp://*:{TFWENV.RECEIVER_PORT}' + address = f'tcp://*:{TFWENV.PULL_PORT}' self._zmq_pull_socket.bind(address) LOG.debug('Pull socket bound to %s', address) @@ -33,7 +33,7 @@ class EventHandlerUplinkConnector(): def __init__(self): self._zmq_pub_socket = zmq.Context.instance().socket(zmq.PUB) self._zmq_pub_socket.setsockopt(zmq.SNDHWM, 0) - address = f'tcp://*:{TFWENV.PUBLISHER_PORT}' + address = f'tcp://*:{TFWENV.PUB_PORT}' self._zmq_pub_socket.bind(address) LOG.debug('Pub socket bound to %s', address) diff --git a/lib/tfw/networking/server_connector.py b/lib/tfw/networking/server_connector.py index da84289..600cb9a 100644 --- a/lib/tfw/networking/server_connector.py +++ b/lib/tfw/networking/server_connector.py @@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__) class ServerDownlinkConnector(): def __init__(self): self._zmq_sub_socket = zmq.Context.instance().socket(zmq.SUB) - self._zmq_sub_socket.connect(f'tcp://localhost:{TFWENV.PUBLISHER_PORT}') + self._zmq_sub_socket.connect(f'tcp://localhost:{TFWENV.PUB_PORT}') self._zmq_sub_socket.setsockopt(zmq.RCVHWM, 0) self._zmq_sub_stream = ZMQStream(self._zmq_sub_socket) @@ -36,7 +36,7 @@ class ServerDownlinkConnector(): class ServerUplinkConnector(): def __init__(self): self._zmq_push_socket = zmq.Context.instance().socket(zmq.PUSH) - self._zmq_push_socket.connect(f'tcp://localhost:{TFWENV.RECEIVER_PORT}') + self._zmq_push_socket.connect(f'tcp://localhost:{TFWENV.PULL_PORT}') self._zmq_push_socket.setsockopt(zmq.SNDHWM, 0) def send_message(self, message, scope=Scope.ZMQ):