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

Client connection resilience on busy #46

Open
pau1a opened this issue Mar 10, 2019 · 0 comments
Open

Client connection resilience on busy #46

pau1a opened this issue Mar 10, 2019 · 0 comments

Comments

@pau1a
Copy link

pau1a commented Mar 10, 2019

Im trying to add some resilience to my clients such that if they attempt to connect to a port on the server that is busy, they automatically increment the port number within the range of open server ports. This is what I am trying. The problem is it seems never to trigger the exception. If I make port 5200 busy with another client, the test seems just to fail silently. Surely I can't be the first person to attempt this. Any ideas how I can force a retry?

client = iperf3.Client()
client.duration = 15
client.server_hostname = 'x.x.x.x'
client.verbose = True
client.reverse = True
print('a')
i = 0
while i < 9:
        print('b')
        try:
                client.port = 5200 + i
                print('c')
                result = client.run()
                print(result.received_Mbps)
                i = 10
                print(str(client.port))
        except:
                i = i + 1
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

1 participant