Adds iperf timeout for bandwith measurements.
This commit is contained in:
@@ -373,10 +373,13 @@ class Server:
|
|||||||
is_measurement_done = False
|
is_measurement_done = False
|
||||||
while not is_measurement_done:
|
while not is_measurement_done:
|
||||||
try:
|
try:
|
||||||
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
|
try:
|
||||||
is_measurement_done = True
|
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
|
||||||
except:
|
is_measurement_done = True
|
||||||
print_message("iPerf timed out. Retry...")
|
except:
|
||||||
|
print_message("iPerf timed out. Retry...")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
exit()
|
||||||
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
|
||||||
@@ -445,13 +448,15 @@ class Server:
|
|||||||
str(self.config["port"]),
|
str(self.config["port"]),
|
||||||
"--one-off",
|
"--one-off",
|
||||||
]
|
]
|
||||||
is_measurement_done = False
|
|
||||||
while not is_measurement_done:
|
while not is_measurement_done:
|
||||||
try:
|
try:
|
||||||
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
|
try:
|
||||||
is_measurement_done = True
|
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
|
||||||
except:
|
is_measurement_done = True
|
||||||
print_message("iPerf timed out. Retry...")
|
except:
|
||||||
|
print_message("iPerf timed out. Retry...")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
exit()
|
||||||
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(
|
||||||
@@ -817,10 +822,13 @@ class Client:
|
|||||||
is_measurement_done = False
|
is_measurement_done = False
|
||||||
while not is_measurement_done:
|
while not is_measurement_done:
|
||||||
try:
|
try:
|
||||||
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
|
try:
|
||||||
is_measurement_done = True
|
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
|
||||||
except:
|
is_measurement_done = True
|
||||||
print_message("iPerf timed out. Retry...")
|
except:
|
||||||
|
print_message("iPerf timed out. Retry...")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
exit()
|
||||||
sleep(4)
|
sleep(4)
|
||||||
processHandler.kill_all()
|
processHandler.kill_all()
|
||||||
congestion_control_index = (congestion_control_index + 1) % len(
|
congestion_control_index = (congestion_control_index + 1) % len(
|
||||||
@@ -878,10 +886,13 @@ class Client:
|
|||||||
is_measurement_done = False
|
is_measurement_done = False
|
||||||
while not is_measurement_done:
|
while not is_measurement_done:
|
||||||
try:
|
try:
|
||||||
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
|
try:
|
||||||
is_measurement_done = True
|
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
|
||||||
except:
|
is_measurement_done = True
|
||||||
print_message("iPerf timed out. Retry...")
|
except:
|
||||||
|
print_message("iPerf timed out. Retry...")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
exit()
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user