0

I'm using Spring Messaging v 5.3.21 for WebSocket. I have following interceptor to validate each request.

@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
    try {
        StompHeaderAccessor headerAccessor = StompHeaderAccessor.wrap(message);
        if (StompCommand.CONNECT.equals(headerAccessor.getCommand())) {
            //Validate request
        }
    } catch (Exception e) {
        //exception handling 
    }
    return message;
}

I want to detect internet failure of clients connected to the service.

I'm unable to find any solution to detect internet disconnect on client side.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • What exactly do you mean by "internet disconnect"? Is that different from other kinds of connection failures? If so, why does it matter _why_ the connection failed? – Justin Bertram Nov 04 '22 at 14:14
  • @JustinBertram I'm currently displaying the usernames of connected users on front end side. The issue is, User disconnects its WIFI, and he still remains in list of connected users because I'm unable to detect client disconnect. – Ammar Zafar Nov 07 '22 at 09:03

0 Answers0