File transfer example

This commit is contained in:
Mark Qvist 2018-04-25 23:05:30 +02:00
parent 8aa2f8613a
commit aa9d0876d7
3 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,7 @@ import RNS.vendor.umsgpack as umsgpack
APP_NAME = "example_utilitites" APP_NAME = "example_utilitites"
# We'll also define a default timeout, in seconds # We'll also define a default timeout, in seconds
APP_TIMEOUT = 5.0 APP_TIMEOUT = 10.0
########################################################## ##########################################################
#### Server Part ######################################### #### Server Part #########################################

View File

@ -29,7 +29,7 @@ class Link:
# TODO: This should not be hardcoded, # TODO: This should not be hardcoded,
# but calculated from something like # but calculated from something like
# first-hop RTT latency and distance # first-hop RTT latency and distance
DEFAULT_TIMEOUT = 5 DEFAULT_TIMEOUT = 10.0
TIMEOUT_FACTOR = 5 TIMEOUT_FACTOR = 5
KEEPALIVE = 120 KEEPALIVE = 120

View File

@ -2,6 +2,7 @@ import os
import RNS import RNS
import time import time
import threading import threading
import traceback
from time import sleep from time import sleep
import vendor.umsgpack as umsgpack import vendor.umsgpack as umsgpack
@ -86,6 +87,7 @@ class Transport:
except Exception as e: except Exception as e:
RNS.log("An exception occurred while running Transport jobs.", RNS.LOG_ERROR) RNS.log("An exception occurred while running Transport jobs.", RNS.LOG_ERROR)
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
traceback.print_exc()
Transport.jobs_running = False Transport.jobs_running = False