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

A connection will be in readystate Open when onWebSocketClose is called #609

Closed
marci4 opened this issue Nov 15, 2017 · 2 comments · Fixed by #610
Closed

A connection will be in readystate Open when onWebSocketClose is called #609

marci4 opened this issue Nov 15, 2017 · 2 comments · Fixed by #610

Comments

@marci4
Copy link
Collaborator

marci4 commented Nov 15, 2017

This is just a tracking issue!

The reason for that is that for example when the method eot() is called, closeConnection() is called directly without calling onClose(). But in onClose() the readystate is changed to closing.

Since closeConnection() is setting the readystate to closed at the end of the method, this is not a real issue, just looks bad.

Expected Behavior

connection is in readystate closing during onWebSocketClose

Current Behavior

connection can be in readystate open during onWebSocketClose e.g. due to end-of-stream error causing a eot() call

Possible Solution

Change the readystate to closing when the readystate is still open and it is a close with CloseFrame.ABNORMAL_CLOSE

Steps to Reproduce (for bugs)

Not needed.

Debug log (for bugs)

Not needed.

Context

Not needed.

Your Environment

  • Version used: 1.3.7-dev
  • Java version: 8
  • Operating System and version: Windows 10
  • Endpoint Name and version: Firefox
  • Link to your project:
@marci4
Copy link
Collaborator Author

marci4 commented Nov 15, 2017

Waiting for feedback on #606 to close this issue!

@marci4
Copy link
Collaborator Author

marci4 commented Nov 18, 2017

Feedback indicates this bug is fixed!

@marci4 marci4 closed this as completed Nov 18, 2017
marci4 added a commit to marci4/Java-WebSocket-Dev that referenced this issue Nov 18, 2017
marci4 added a commit that referenced this issue Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant