summaryrefslogtreecommitdiff
path: root/src/leap/common/events/txclient.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-02-22 19:26:45 -0400
committerKali Kaneko <kali@leap.se>2016-02-23 19:32:20 -0400
commitb940cfc29b88374ce57b101a39bc012bb903f6e8 (patch)
treece4e6ee7a1715e875392242ddeb9b6b6182e0fea /src/leap/common/events/txclient.py
parent88941164243ce1ac6f30c790120165c04ea4a041 (diff)
[bug] avoid the events server to block twistd daemon
1. refactor the zmq_connect/bind methods to use the txzmq addEndpoints mechanism, which cleans up the code a bit. it uses the underlying bindOrConnect method. 2. wrap the addEndpoints call in a helper function that ensures that doRead is called afterward. I'm not fully comfortable with us still using the AuthenticatorThread, I believe we could go witha txzmq-based authenticator for curve.
Diffstat (limited to 'src/leap/common/events/txclient.py')
-rw-r--r--src/leap/common/events/txclient.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/leap/common/events/txclient.py b/src/leap/common/events/txclient.py
index dfd0533..ca247ca 100644
--- a/src/leap/common/events/txclient.py
+++ b/src/leap/common/events/txclient.py
@@ -28,9 +28,10 @@ some other client.
import logging
import pickle
+from leap.common.events.zmq_components import TxZmqClientComponent
+
import txzmq
-from leap.common.events.zmq_components import TxZmqClientComponent
from leap.common.events.client import EventsClient
from leap.common.events.client import configure_client
from leap.common.events.server import EMIT_ADDR
@@ -68,6 +69,7 @@ class EventsTxClient(TxZmqClientComponent, EventsClient):
# same client
self._sub = self._zmq_connect(txzmq.ZmqSubConnection, reg_addr)
self._sub.gotMessage = self._gotMessage
+
self._push = self._zmq_connect(txzmq.ZmqPushConnection, emit_addr)
def _gotMessage(self, msg, tag):
@@ -122,7 +124,6 @@ class EventsTxClient(TxZmqClientComponent, EventsClient):
callback(event, *content)
def shutdown(self):
- TxZmqClientComponent.shutdown(self)
EventsClient.shutdown(self)