public abstract class BaseHandler
extends org.springframework.web.socket.handler.TextWebSocketHandler
| Constructor and Description |
|---|
BaseHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterConnectionClosed(org.springframework.web.socket.WebSocketSession session,
org.springframework.web.socket.CloseStatus status) |
void |
afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session) |
protected void |
afterConnectionEstablishedImpl(org.springframework.web.socket.WebSocketSession session)
建立会话后
|
abstract void |
destroy(org.springframework.web.socket.WebSocketSession session)
关闭连接
|
void |
handleTransportError(org.springframework.web.socket.WebSocketSession session,
Throwable exception) |
protected void |
logOpt(Class<?> cls,
Map<String,Object> attributes,
Object reqData)
操作 websocket 日志
|
protected void |
sendMsg(org.springframework.web.socket.WebSocketSession session,
String msg) |
protected void |
showHelloMsg(Map<String,Object> attributes,
org.springframework.web.socket.WebSocketSession session) |
handleBinaryMessagepublic void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession session)
throws Exception
afterConnectionEstablished in interface org.springframework.web.socket.WebSocketHandlerafterConnectionEstablished in class org.springframework.web.socket.handler.AbstractWebSocketHandlerExceptionprotected void showHelloMsg(Map<String,Object> attributes, org.springframework.web.socket.WebSocketSession session)
protected void afterConnectionEstablishedImpl(org.springframework.web.socket.WebSocketSession session)
throws Exception
session - 会话Exception - 异常public void handleTransportError(org.springframework.web.socket.WebSocketSession session,
Throwable exception)
handleTransportError in interface org.springframework.web.socket.WebSocketHandlerhandleTransportError in class org.springframework.web.socket.handler.AbstractWebSocketHandlerpublic void afterConnectionClosed(org.springframework.web.socket.WebSocketSession session,
org.springframework.web.socket.CloseStatus status)
afterConnectionClosed in interface org.springframework.web.socket.WebSocketHandlerafterConnectionClosed in class org.springframework.web.socket.handler.AbstractWebSocketHandlerpublic abstract void destroy(org.springframework.web.socket.WebSocketSession session)
session - sessionprotected void sendMsg(org.springframework.web.socket.WebSocketSession session,
String msg)
Copyright © 2017–2022. All rights reserved.