devilkazuya99
devilkazuya99

Reputation: 51

How to close websocket from server using spring

I am using spring framework and spring websocket 4.0.6.

I am work with web-socket and I need to find way to close them from server.

Is there way do do it ?

Upvotes: 2

Views: 4712

Answers (1)

Brian Clozel
Brian Clozel

Reputation: 59221

Once you've got a reference to a User session (probably a SockJSSession if you're using sockjs), you can manually close the session:

session.close();

See the javadoc for reference

Upvotes: 1

Related Questions