reset _listeningPort and _listening Deferred on teardown
This commit is contained in:
parent
3dfc6bd2cc
commit
a952d2d2c8
2 changed files with 3 additions and 0 deletions
|
@ -159,6 +159,7 @@ class Node(MockKademliaHelper):
|
|||
yield self.safe_stop_looping_call(self._change_token_lc)
|
||||
if self._listeningPort is not None:
|
||||
yield self._listeningPort.stopListening()
|
||||
self._listeningPort = None
|
||||
|
||||
def start_listening(self):
|
||||
if not self._listeningPort:
|
||||
|
|
|
@ -171,6 +171,8 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
|||
|
||||
def startProtocol(self):
|
||||
log.info("DHT listening on UDP %s:%i", self._node.externalIP, self._node.port)
|
||||
if self._listening.called:
|
||||
self._listening = defer.Deferred()
|
||||
self._listening.callback(True)
|
||||
return self._ping_queue.start()
|
||||
|
||||
|
|
Loading…
Reference in a new issue