My code sends a message and within 100 ms, the onClosed() gets called with CloseReason CLOSED_ABNORMALLY An unrecoverable IOException occurred so the connection was closed

3

1 Answer

Found out the issue.

The issue was in the message handler (onMessage()). While parsing the response into a json, there was a unhandled parsing exception. That caused an IOException to be thrown which caused the session to close. It is unintuitive that the session gets closed, while there is no meaningful indication that the IOException happened inside the onMessage(). Once i handled the exception, the session stays open.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.