WebSocket connect/disconnect Events
vw98075 opened this issue · comments
The WebSocket connect/disconnect part doesn't seem to be completed in the back-end Java code. I add the following code to react when the connect button is triggered.
@component
public class WebSocketSessionListener implements ApplicationListener{
@Override
@EventListener
public void onApplicationEvent(SessionConnectEvent event) {
// handle the connect event
System.out.println("WebSocket session connected: " + event.getMessage().toString());
}
}
It detects the event, but the events of both connect and disconnect are fired twice for some reason.
and has other methods ? such as the service active to disconnect the service.no the user to disconnect the service or how to do when the user disconnect . the service to do something ?
We keep the guides as simple as possible (because we want them to be completable in 15 minutes). You should ask that question on Stack Overflow.