-
Notifications
You must be signed in to change notification settings - Fork 187
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
Gracefully close open WebSocket connections when server shuts down. #77
Comments
Might be related to #41 |
As part of doing this we should probably add a |
Should this also attempt to "catch" exceptions and do |
@KushalP do you mean IO exceptions or other exceptions? Got an example? What do you mean by leaving them hanging? |
Yes. In the case of IO exceptions, should we catch them (provisionally) to close the WebSocket connections and then throw the IO exception back out? My thinking behind this is to prevent clients from attempting to communicate with a server that has failed. |
I'm still not sure I understand...
I don't understand how this would work. We wouldn't get an IO exception unless the socket is hosed, in which case we can't send a CLOSE frame at all. Am I missing something here? (IO exceptions are already caught and sent to the |
Perhaps this is a bit silly to try and pull off in practice. Don't worry about this for the moment. I'll have a proper think (and look through the spec) and get back to you if this is feasible. |
When the server shuts down it should call
WebSocketConnection.close()
on all open connections. This will send aCLOSE
frame to the connected client, preventing IO exceptions in the clients.The text was updated successfully, but these errors were encountered: