You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
It's not possible to abort an opening websocket connection #205
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:
if (_websocket.canSendMessage) {
_debug("invoking .close() on WebSocket object");
_websocket.close();
}
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:
Activity
yerfinojul commentedon Oct 24, 2016
@jfarcand any updates on this issue ?
jfarcand commentedon Oct 24, 2016
@yerfinojul Contribution welcomed...I have
zerotime to work on this for the next couple of months :-)Atmosphere#205 - It's not possible to abort an opening websocket conn…
yerfinojul commentedon Mar 29, 2017
@jfarcand pull request created, I don't see any problems in my tests but you might know better than me.
danielgrad commentedon Nov 20, 2018
@jfarcand I see the issue is closed, but not solved (above PR has never been merged). is there a plan to fix this?