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

Use socket isConnected() method rather than isBound() #964

Merged
merged 1 commit into from Jan 12, 2020

Conversation

olivierayache
Copy link
Contributor

Description

It is possible that the socket is already bound and not connected. In this case the connection to the server will never happened.

Related Issue

Fixes #962

Motivation and Context

I found this bug in Android context. In this context, I used setSocketFactory method on WebSocketClient with a socket factory which automatically bind created sockets to a defined network interface. In this case WebSocketClient will never connect to the server.

How Has This Been Tested?

A non regression test has been written in tests package (Issue962Test).
The test fails before the correction was applied.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@marci4 marci4 added the Client label Jan 12, 2020
@marci4 marci4 self-requested a review January 12, 2020 17:05
@marci4 marci4 added this to the Release 1.4.1 milestone Jan 12, 2020
@marci4
Copy link
Collaborator

marci4 commented Jan 12, 2020

Hello @olivierayache,
thx for your pull request.

Best regards,
Marcel

@marci4 marci4 changed the title Use socket isConnected() method rather than isBound() before connect Use socket isConnected() method rather than isBound() before con… Jan 12, 2020
@marci4 marci4 merged commit 31fc335 into TooTallNate:master Jan 12, 2020
@marci4 marci4 changed the title Use socket isConnected() method rather than isBound() before con… Use socket isConnected() method rather than isBound() Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements in socket connect to server
2 participants