summaryrefslogtreecommitdiff
path: root/src/leap/common/events/server.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/server.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/server.py')
-rw-r--r--src/leap/common/events/server.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/leap/common/events/server.py b/src/leap/common/events/server.py
index 7126723..30a0c44 100644
--- a/src/leap/common/events/server.py
+++ b/src/leap/common/events/server.py
@@ -14,31 +14,27 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-
"""
The server for the events mechanism.
"""
-
-
import logging
import platform
-import txzmq
from leap.common.zmq_utils import zmq_has_curve
from leap.common.events.zmq_components import TxZmqServerComponent
+import txzmq
+
if zmq_has_curve() or platform.system() == "Windows":
- # Windows doesn't have icp sockets, we need to use always tcp
+ # Windows doesn't have ipc sockets, we need to use always tcp
EMIT_ADDR = "tcp://127.0.0.1:9000"
REG_ADDR = "tcp://127.0.0.1:9001"
else:
EMIT_ADDR = "ipc:///tmp/leap.common.events.socket.0"
REG_ADDR = "ipc:///tmp/leap.common.events.socket.1"
-
logger = logging.getLogger(__name__)