Skip to content
Permalink
Browse files

Transit: properly virtualize reactor in _build_listener

  • Loading branch information
warner committed Feb 7, 2020
1 parent 0c43499 commit aead2495761ede279c3b49b1f389f35940656fed
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/wormhole/transit.py
@@ -10,7 +10,6 @@

import six
from nacl.secret import SecretBox
import twisted.internet
from twisted.internet import (address, defer, endpoints, error, interfaces,
protocol, task)
from twisted.internet.defer import inlineCallbacks, returnValue
@@ -581,7 +580,7 @@ def __init__(self,
self._listener = None
self._winner = None
if reactor is None:
reactor = twisted.internet.reactor
from twisted.internet import reactor
self._reactor = reactor
self._timing = timing or DebugTiming()
self._timing.add("transit")
@@ -599,7 +598,7 @@ def _build_listener(self):
direct_hints = [
DirectTCPV1Hint(six.u(addr), portnum, 0.0) for addr in addresses
]
ep = endpoints.serverFromString(twisted.internet.reactor, "tcp:%d" % portnum)
ep = endpoints.serverFromString(self._reactor, "tcp:%d" % portnum)
return direct_hints, ep

def get_connection_abilities(self):

0 comments on commit aead249

Please sign in to comment.
You can’t perform that action at this time.