Skip to content

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.

3 participants