What is the proper way to use Spring WebSocketConnectionManager when sessions closes

In one of my projects, I came around similar situation. So, I resorted on using start() and stop() method with access to WebSocketManager as a bean in a connection manager class. I'd created a sample project for websocketserver and websocketclient sometime back. Just added reconnect feature to it.

Also, I was not reconnecting on every connection close. Only on close status 1006(Abnormal Closure), 1011(Internal Error) and 1012(Service Restart).

The project can be directly downloaded and run.