diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/muxconfig.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gui/muxconfig.py b/gui/muxconfig.py index 3888a6c..35587f4 100644 --- a/gui/muxconfig.py +++ b/gui/muxconfig.py @@ -106,22 +106,22 @@ class ConfigurationHandler(object): #self.sock.connect("tcp://{}:{}".format(self._host, self._port)) def zRead(self, key): - self._ctx = zmq.Context() + self._ctx = zmq.Context() self.sock = zmq.Socket(self._ctx, zmq.REQ) self.sock.setsockopt(zmq.LINGER, 0) self.sock.connect("tcp://{}:{}".format(self._host, self._port)) - self.sock.send(key) + self.sock.send(key) - # use poll for timeouts: - poller = zmq.Poller() - poller.register(self.sock, zmq.POLLIN) - if poller.poll(5*1000): # 5s timeout in milliseconds - recv = self.sock.recv() - self.sock.close() - self._ctx.term() - return recv - else: - raise IOError("Timeout processing ZMQ request") + # use poll for timeouts: + poller = zmq.Poller() + poller.register(self.sock, zmq.POLLIN) + if poller.poll(5*1000): # 5s timeout in milliseconds + recv = self.sock.recv() + self.sock.close() + self._ctx.term() + return recv + else: + raise IOError("Timeout processing ZMQ request") def load(self): """Load the configuration from the multiplexer and save it locally""" |