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

Fix for #226. #227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

emmawillemsma
Copy link

Currently the client init uses only the first address info tuple returned from socket.getaddrinfo() to create the socket (see line 97). Unfortunately sometimes this isn't the right address. Best practice is to iterate through the address info tuples until we find one that we can connect to successfully. See this stack overflow question. This change necessitated moving the call to socket.connect out of the WebSocketBaseClient.connect method and into the WebSocketBaseClient.init method. If that is not desirable, we could instead pass the list of address information into the connect method and let the initialization of the socket happen there.

@emmawillemsma
Copy link
Author

The unit tests don't seem to be set up to allow connecting to the socket in the init. Need to investigate further.

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

Successfully merging this pull request may close these issues.

None yet

3 participants