From 9b0661158790272e21821fbe428e381df00faf0d Mon Sep 17 00:00:00 2001 From: Lukas Prause Date: Fri, 14 Oct 2022 13:53:34 +0200 Subject: [PATCH] Adds iperf timeout for bandwith measurements. --- measurement_main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/measurement_main.py b/measurement_main.py index 4174fe6..18877e5 100755 --- a/measurement_main.py +++ b/measurement_main.py @@ -803,10 +803,11 @@ class Client: tcp_algo[congestion_control_index], ] is_measurement_done = False - while not is_measurement_done: + iperf_return = 0 + while not is_measurement_done or iperf_return != 0: try: try: - subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) + iperf_return = subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) is_measurement_done = True except: print_message("iPerf timed out. Retry...") @@ -868,10 +869,11 @@ class Client: ) sleep(2) is_measurement_done = False - while not is_measurement_done: + iperf_return = 0 + while not is_measurement_done or iperf_return != 0: try: try: - subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) + iperf_return = subprocess.call(iperf_command, timeout=float(time) + TIMEOUT_OFFSET) is_measurement_done = True except: print_message("iPerf timed out. Retry...")