From 652275159d758db0babf203f04342e6b7344ed25 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 12 Mar 2022 11:59:04 +0000 Subject: [PATCH] Relay: Tweak for zmq changes --- src/eddn/Relay.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/eddn/Relay.py b/src/eddn/Relay.py index 131b497..749c914 100644 --- a/src/eddn/Relay.py +++ b/src/eddn/Relay.py @@ -27,6 +27,10 @@ import simplejson import zmq.green as zmq from bottle import Bottle, response from gevent import monkey +from zmq import PUB as ZMQ_PUB +from zmq import SUB as ZMQ_SUB +from zmq import SNDHWM as ZMQ_SNDHWM +from zmq import SUBSCRIBE as ZMQ_SUBSCRIBE from eddn.conf.Settings import Settings, load_config @@ -113,15 +117,15 @@ class Relay(Thread): # These form the connection to the Gateway daemon(s) upstream. context = zmq.Context() - receiver = context.socket(zmq.SUB) - receiver.setsockopt_string(zmq.SUBSCRIBE, '') + receiver = context.socket(ZMQ_SUB) + receiver.setsockopt_string(ZMQ_SUBSCRIBE, '') for binding in Settings.RELAY_RECEIVER_BINDINGS: # Relays bind upstream to an Announcer, or another Relay. receiver.connect(binding) - sender = context.socket(zmq.PUB) - sender.setsockopt(zmq.SNDHWM, 500) + sender = context.socket(ZMQ_PUB) + sender.setsockopt(ZMQ_SNDHWM, 500) for binding in Settings.RELAY_SENDER_BINDINGS: # End users, or other relays, may attach here.