iperf3-python icon indicating copy to clipboard operation
iperf3-python copied to clipboard

I can't take several measures

Open Castaneira7 opened this issue 7 years ago • 2 comments

I would like to repeat the tests several times to relieve the bandwidth of an entire room. but when I repeat the test it gives me an error that I suppose is to rewrite the variable result = client.run ()

Traceback (most recent call last): File "/home/pi/Desktop/test1.py", line 19, in test = client.run() File "/usr/local/lib/python3.5/dist-packages/iperf3-0.1.10-py3.5.egg/iperf3/iperf3.py", line 612, in run output_to_screen(self._stdout_fd, self.stderr_fd) # enable stdout File "/usr/local/lib/python3.5/dist-packages/iperf3-0.1.10-py3.5.egg/iperf3/iperf3.py", line 80, in output_to_screen os.dup2(stdout_fd, 1) OSError: [Errno 9] Bad file descriptor**

any help??

Castaneira7 avatar Oct 01 '18 22:10 Castaneira7

I hit this toady 'OSError: [Errno 9] Bad file descriptor' trying to run two tests in a singe function. My work around was.

def iperfSingleTest():
  <test setup> 
  result = client.run ()
  print(result)

def iperfManyTests():
  for i in range(1,3):
    iperfSingleTest()

Hope this helps

iamjarvs avatar Oct 23 '18 13:10 iamjarvs

I got a workaround here:

print("starting test")
for i in range(ITERATIONS):
  test = new_client_configure()
  r = test.run()
  print("{}".format(r.received_Mbps))
  del test
  time.sleep(2)

Delete the testing object to initiate the __del__ function to close the sockets.

ckleu avatar Oct 26 '18 13:10 ckleu