Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Should session.close() be called in onWebSocketClose and onWebSocketError?

Dear Jetty users,

I have questions related to WebSocketListener implementation like the one here:

https://www.eclipse.org/jetty/documentation/current/jetty-websocket-api-listener.html

Should I call session.close() method in the callbacks onWebSocketClose and onWebSocketError in order to "properly" close the connection?

Also, when onWebSocketError was called, does it mean the websocket connection is closed? Or does it mean a temporary failure and should I retry calling session.getRemote().sendString(message,null) again?

Thank you
Alex

Back to the top