Improve ZMQ port envvar names

This commit is contained in:
Kristóf Tóth 2019-05-27 20:11:03 +02:00
parent e44a99fa6d
commit f151ecfbac
3 changed files with 6 additions and 6 deletions

View File

@ -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}

View File

@ -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)

View File

@ -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):