'How to implement a heartbeat on Spring (Pure) Websockets?

I have a Spring websocket handler (no stomp and not socketjs), I see in docs that the websocket implementation of Spring doesn't include a heartbeat method.

I cannot detect a client "gone away" disconnection by handleTransportError or afterConnectionClosed methods. How can I implement it?



Solution 1:[1]

If you created handler, then you created - server part. The logic which handles requests from clients.

You could create some client code and sent test message from it.

From server side you will see how exactly it is processed by the logs.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 moon_coder