Skip to main content

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

Considering that WebSocketClient's lifecycle for stop will iterate through all Sessions still being tracked and close them, you've just created a logic loop.

If you want to stop the WebSocketClient, you should do that outside of the scope of a Session or Endpoint.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Mon, Jun 27, 2016 at 1:13 PM, Michael Velbaum <michael.vm@xxxxxxxxx> wrote:
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!


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top