From 3e7ab5136ee06fe664426db1738e5cd69c8d55d9 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 19 Jan 2025 00:57:36 +0100 Subject: [PATCH] Better thread configuration --- RNS/Interfaces/LocalInterface.py | 1 + RNS/Transport.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RNS/Interfaces/LocalInterface.py b/RNS/Interfaces/LocalInterface.py index 86b6b1a..0e39b54 100644 --- a/RNS/Interfaces/LocalInterface.py +++ b/RNS/Interfaces/LocalInterface.py @@ -319,6 +319,7 @@ class LocalServerInterface(Interface): address = (self.bind_ip, self.bind_port) self.server = ThreadingTCPServer(address, handlerFactory(self.incoming_connection)) + self.server.daemon_threads = True thread = threading.Thread(target=self.server.serve_forever) thread.daemon = True diff --git a/RNS/Transport.py b/RNS/Transport.py index 5fb88c9..231dcee 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -2690,7 +2690,7 @@ class Transport: def detach_job(): RNS.log(f"Detaching {interface}", RNS.LOG_EXTREME) interface.detach() - dt = threading.Thread(target=detach_job, daemon=True) + dt = threading.Thread(target=detach_job, daemon=False) dt.start() detach_threads.append(dt)