From 540bde4cd4401f0a19d6f91e8f700a95ea975f28 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 26 Apr 2018 11:29:21 +0200 Subject: [PATCH] Transport job callback in thread --- RNS/Interfaces/RNodeInterface.py | 1 + RNS/Transport.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index 76ec9ed..5ddd9b3 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -144,6 +144,7 @@ class RNodeInterface(Interface): if (self.validateRadioState()): self.interface_ready = True RNS.log(str(self)+" is configured and powered up") + sleep(1.0) else: RNS.log("After configuring "+str(self)+", the actual radio parameters did not match your configuration.", RNS.LOG_ERROR) RNS.log("Make sure that your hardware actually supports the parameters specified in the configuration", RNS.LOG_ERROR) diff --git a/RNS/Transport.py b/RNS/Transport.py index b58987b..c4bc631 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -74,7 +74,9 @@ class Transport: # Process receipts list for timed-out packets if Transport.receipts_last_checked+Transport.receipts_check_interval < time.time(): for receipt in Transport.receipts: - receipt.check_timeout() + thread = threading.Thread(target=receipt.check_timeout) + thread.setDaemon(True) + thread.start() if receipt.status != RNS.PacketReceipt.SENT: Transport.receipts.remove(receipt)