mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-06-08 15:02:46 -04:00
Improved daemon restart time on systems with many interfaces
This commit is contained in:
parent
a56d93fc1e
commit
ad1e6a41ee
3 changed files with 8 additions and 1 deletions
|
@ -539,6 +539,7 @@ class TCPServerInterface(Interface):
|
|||
else:
|
||||
ThreadingTCPServer.allow_reuse_address = True
|
||||
self.server = ThreadingTCPServer(bind_address, handlerFactory(self.incoming_connection))
|
||||
self.server.daemon_threads = True
|
||||
|
||||
self.bitrate = TCPServerInterface.BITRATE_GUESS
|
||||
|
||||
|
@ -606,13 +607,15 @@ class TCPServerInterface(Interface):
|
|||
pass
|
||||
|
||||
def detach(self):
|
||||
self.detached = True
|
||||
self.online = False
|
||||
if self.server != None:
|
||||
if hasattr(self.server, "shutdown"):
|
||||
if callable(self.server.shutdown):
|
||||
try:
|
||||
RNS.log("Detaching "+str(self), RNS.LOG_DEBUG)
|
||||
self.server.shutdown()
|
||||
self.detached = True
|
||||
self.server.server_close()
|
||||
self.server = None
|
||||
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue