Java – how do I capture connection events in my websocket server using spring 4?

I use spring 4, stomp and sock JS for simple web socket communication, follow this https://github.com/rstoyanchev/spring-websocket-portfolio And this

Well, I wonder if it is possible to capture connection events, such as when a new client connects to my server or when the client disconnects, whether it can be in spring 4.0 In 0?

Solution

This can be done through the connection handshake interceptor (httpsessionhandshakeinterceptor), which references the document:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>