| self.config["server"], | self.config["server"], | ||||
| self.config["port"], | self.config["port"], | ||||
| ) | ) | ||||
| is_measurement_done = False | |||||
| return_code = 0 | |||||
| while not is_measurement_done or return_code != 0: | |||||
| try: | |||||
| try: | |||||
| return_code = subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET) | |||||
| is_measurement_done = True | |||||
| except: | |||||
| print_message("iPerf timed out. Retry...") | |||||
| except KeyboardInterrupt: | |||||
| exit() | |||||
| 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 | ||||
| str(self.config["port"]), | str(self.config["port"]), | ||||
| "--one-off", | "--one-off", | ||||
| ] | ] | ||||
| is_measurement_done = False | |||||
| return_code = 0 | |||||
| while not is_measurement_done or return_code != 0: | |||||
| try: | |||||
| try: | |||||
| return_code= subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET) | |||||
| is_measurement_done = True | |||||
| except: | |||||
| print_message("iPerf timed out. Retry...") | |||||
| except KeyboardInterrupt: | |||||
| exit() | |||||
| 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( | ||||
| tcp_algo[congestion_control_index], | tcp_algo[congestion_control_index], | ||||
| ] | ] | ||||
| is_measurement_done = False | is_measurement_done = False | ||||
| return_code = 0 | |||||
| while not is_measurement_done or return_code != 0: | |||||
| while not is_measurement_done: | |||||
| try: | try: | ||||
| try: | try: | ||||
| return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) | |||||
| subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) | |||||
| is_measurement_done = True | is_measurement_done = True | ||||
| except: | except: | ||||
| print_message("iPerf timed out. Retry...") | print_message("iPerf timed out. Retry...") | ||||
| ) | ) | ||||
| sleep(2) | sleep(2) | ||||
| is_measurement_done = False | is_measurement_done = False | ||||
| return_code = 0 | |||||
| while not is_measurement_done or return_code != 0: | |||||
| while not is_measurement_done: | |||||
| try: | try: | ||||
| try: | try: | ||||
| return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) | |||||
| subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET) | |||||
| is_measurement_done = True | is_measurement_done = True | ||||
| except: | except: | ||||
| print_message("iPerf timed out. Retry...") | print_message("iPerf timed out. Retry...") |