Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't take several measures #37

Open
Castaneira7 opened this issue Oct 1, 2018 · 2 comments
Open

I can't take several measures #37

Castaneira7 opened this issue Oct 1, 2018 · 2 comments

Comments

@Castaneira7
Copy link

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??

@iamjarvs
Copy link

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

@ckleu
Copy link

ckleu commented Oct 26, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants