From 04f3b385ec3c02e8abd5cb70631631bccc0a677a Mon Sep 17 00:00:00 2001 From: Lukas Prause Date: Fri, 14 Oct 2022 13:47:32 +0200 Subject: [PATCH] Adds iperf timeout for bandwith measurements. --- measurement_main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/measurement_main.py b/measurement_main.py index 47421c3..4174fe6 100755 --- a/measurement_main.py +++ b/measurement_main.py @@ -370,9 +370,7 @@ class Server: self.config["server"], self.config["port"], ) - subprocess.call(iperf_command) - processHandler.kill_all() congestion_control_index = (congestion_control_index + 1) % len( tcp_algo @@ -441,9 +439,7 @@ class Server: str(self.config["port"]), "--one-off", ] - subprocess.call(iperf_command) - sleep(2) processHandler.kill_all() congestion_control_index = (congestion_control_index + 1) % len( @@ -810,10 +806,11 @@ class Client: while not is_measurement_done: try: try: - subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) + subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) is_measurement_done = True except: print_message("iPerf timed out. Retry...") + reconnect_modem() except KeyboardInterrupt: exit() sleep(4) @@ -874,10 +871,11 @@ class Client: while not is_measurement_done: try: try: - subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) + subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) is_measurement_done = True except: print_message("iPerf timed out. Retry...") + reconnect_modem() except KeyboardInterrupt: exit() processHandler.kill_all()