Adds iperf timeout for bandwith measurements.

This commit is contained in:
Lukas Prause
2022-10-14 13:47:32 +02:00
parent bcfc8e919c
commit 04f3b385ec

View File

@@ -370,9 +370,7 @@ class Server:
self.config["server"], self.config["server"],
self.config["port"], self.config["port"],
) )
subprocess.call(iperf_command) subprocess.call(iperf_command)
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
tcp_algo tcp_algo
@@ -441,9 +439,7 @@ class Server:
str(self.config["port"]), str(self.config["port"]),
"--one-off", "--one-off",
] ]
subprocess.call(iperf_command) subprocess.call(iperf_command)
sleep(2) sleep(2)
processHandler.kill_all() processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len( congestion_control_index = (congestion_control_index + 1) % len(
@@ -810,10 +806,11 @@ class Client:
while not is_measurement_done: while not is_measurement_done:
try: try:
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 is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")
reconnect_modem()
except KeyboardInterrupt: except KeyboardInterrupt:
exit() exit()
sleep(4) sleep(4)
@@ -874,10 +871,11 @@ class Client:
while not is_measurement_done: while not is_measurement_done:
try: try:
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 is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")
reconnect_modem()
except KeyboardInterrupt: except KeyboardInterrupt:
exit() exit()
processHandler.kill_all() processHandler.kill_all()