コード例 #1
0
 /**
  * The user closes the connection.
  *
  * <p>Note: you can't send messages to the client from this method
  */
 @OnClose
 public void onClose(Session session) {
   serverStateHolder.removeSession(session);
 }
コード例 #2
0
 /**
  * @OnOpen allows us to intercept the creation of a new session. The session class allows us to
  * send data to the user. In the method onOpen, we'll let the user know that the handshake was
  * successful.
  */
 @OnOpen
 public void onOpen(Session session) {
   serverStateHolder.addInitSession(session);
 }