コード例 #1
0
 /** 会话抛出异常 */
 @Override
 public void handleTransportError(WebSocketSession session, Throwable arg1) throws Exception {
   // TODO Auto-generated method stub
   if (session.isOpen()) {
     session.close();
   }
   WebSocketCache.removeMemberSession(session);
 }
コード例 #2
0
  /** 会话关闭 */
  @Override
  public void afterConnectionClosed(WebSocketSession session, CloseStatus arg1) throws Exception {

    WebSocketCache.removeMemberSession(session);
  }