-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
It's not possible to abort an opening websocket connection #205
Comments
@jfarcand any updates on this issue ? |
@yerfinojul Contribution welcomed...I have |
yerfinojul
pushed a commit
to yerfinojul/atmosphere-javascript
that referenced
this issue
Mar 29, 2017
@jfarcand pull request created, I don't see any problems in my tests but you might know better than me. |
@jfarcand I see the issue is closed, but not solved (above PR has never been merged). is there a plan to fix this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's possible to reproduce this situation setting a
connectTimeout
to something like 15 seconds.If the server is unresponsive for some reason and this timeout is reached, then there is no way to close this connection, which could be established anyway after the timeout is reached, calling close() or unsubcribe() has no effect because of this code:
So, bottom line, you end up with a useless connection that you cannot close.
I think it should be possible to call close() as long as the readyState is 0 or 1 (OPENING or OPEN).
Is there a real reason to do that "if" ?
According to the websocket spec when "the WebSocket connection is not yet established [WSP]
Fail the WebSocket connection and set the readyState attribute's value to CLOSING (2). [WSP]"
NOTE: to simulate an unresponsive server you can just use netcat, e.g. on mac:
Thanks
The text was updated successfully, but these errors were encountered: