forked from LBRYCommunity/lbry-sdk
safe start_listening
This commit is contained in:
parent
5013426e02
commit
4eab77fa10
1 changed files with 9 additions and 6 deletions
|
@ -168,12 +168,15 @@ class Node(object):
|
|||
yield self.hash_watcher.stop()
|
||||
|
||||
def start_listening(self):
|
||||
try:
|
||||
self._listeningPort = self.reactor_listenUDP(self.port, self._protocol)
|
||||
except error.CannotListenError as e:
|
||||
import traceback
|
||||
log.error("Couldn't bind to port %d. %s", self.port, traceback.format_exc())
|
||||
raise ValueError("%s lbrynet may already be running." % str(e))
|
||||
if not self._listeningPort:
|
||||
try:
|
||||
self._listeningPort = self.reactor_listenUDP(self.port, self._protocol)
|
||||
except error.CannotListenError as e:
|
||||
import traceback
|
||||
log.error("Couldn't bind to port %d. %s", self.port, traceback.format_exc())
|
||||
raise ValueError("%s lbrynet may already be running." % str(e))
|
||||
else:
|
||||
log.warning("Already bound to port %d", self._listeningPort.port)
|
||||
|
||||
def bootstrap_join(self, known_node_addresses, finished_d):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue