From 743931c7c124c8e409424c0f350dd72637163c64 Mon Sep 17 00:00:00 2001 From: Andre Merzky Date: Sun, 24 Nov 2024 22:13:37 +0100 Subject: [PATCH] snap --- src/radical/utils/zmq/pubsub.py | 4 ++-- src/radical/utils/zmq/queue.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/radical/utils/zmq/pubsub.py b/src/radical/utils/zmq/pubsub.py index d231003b..b625761d 100644 --- a/src/radical/utils/zmq/pubsub.py +++ b/src/radical/utils/zmq/pubsub.py @@ -100,12 +100,12 @@ def _bridge_initialize(self): self._xpub = self._ctx.socket(zmq.XSUB) self._xpub.linger = _LINGER_TIMEOUT self._xpub.hwm = _HIGH_WATER_MARK - self._xpub.bind('tcp://*:*') + self._xpub.bind('tcp://*:%s' % (self._cfg.get('port_pub') or '10000+')) self._xsub = self._ctx.socket(zmq.XPUB) self._xsub.linger = _LINGER_TIMEOUT self._xsub.hwm = _HIGH_WATER_MARK - self._xsub.bind('tcp://*:*') + self._xsub.bind('tcp://*:%s' % (self._cfg.get('port_sub') or '10000+')) # communicate the bridge ports to the parent process _addr_pub = as_string(self._xpub.getsockopt(zmq.LAST_ENDPOINT)) diff --git a/src/radical/utils/zmq/queue.py b/src/radical/utils/zmq/queue.py index fcb3a8c9..302b2885 100644 --- a/src/radical/utils/zmq/queue.py +++ b/src/radical/utils/zmq/queue.py @@ -165,19 +165,18 @@ def _bridge_initialize(self): self._log.info('start bridge %s', self._uid) - self._url = 'tcp://*:*' - self._lock = mt.Lock() + self._lock = mt.Lock() - self._ctx = zmq.Context() # rely on GC for destruction + self._ctx = zmq.Context() # rely on GC for destruction self._put = self._ctx.socket(zmq.PULL) self._put.linger = _LINGER_TIMEOUT self._put.hwm = _HIGH_WATER_MARK - self._put.bind(self._url) + self._get.bind('tcp://*:%s' % (self._cfg.get('port_put') or find_port()) self._get = self._ctx.socket(zmq.REP) self._get.linger = _LINGER_TIMEOUT self._get.hwm = _HIGH_WATER_MARK - self._get.bind(self._url) + self._get.bind('tcp://*:%s' % (self._cfg.get('port_get') or find_port()) # communicate the bridge ports to the parent process _addr_put = as_string(self._put.getsockopt(zmq.LAST_ENDPOINT))