From 4e136eea03401ad8206b5a6371f9f64488d38f07 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 25 Apr 2018 23:10:26 +0200 Subject: [PATCH] File transfer example --- RNS/Link.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RNS/Link.py b/RNS/Link.py index da2a167..4819e23 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -29,8 +29,8 @@ class Link: # TODO: This should not be hardcoded, # but calculated from something like # first-hop RTT latency and distance - DEFAULT_TIMEOUT = 10.0 - TIMEOUT_FACTOR = 5 + DEFAULT_TIMEOUT = 15.0 + TIMEOUT_FACTOR = 3 KEEPALIVE = 120 PENDING = 0x00 @@ -225,7 +225,7 @@ class Link: return None def teardown(self): - if self.status != Link.PENDING: + if self.status != Link.PENDING and self.status != Link.CLOSED: teardown_packet = RNS.Packet(self, self.link_id, context=RNS.Packet.LINKCLOSE) teardown_packet.send() self.status = Link.CLOSED