Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Stopping WebSocketClient from onClose() callback

Hi,

I'm interacting with a web-service which allows me as to initiate a websocket connection (to receive updates) as part of my regular login session. In case the WebSocket gets closed (the onClose() handler is called), I would like to terminate my own session-related data structures cleanly and mark the session as closed.

Currently, once the onClose() is called, it calls my own session.close() function which ends up calling webSocketClient.stop().

Is it legal to call stop() on the WS client while inside the onClose() handler?
If not, do you have any recommendation on how else to free up resources of the WebSocketClient?

Thanks!


Back to the top