接口 SockJsSession
- 所有超级接口:
AutoCloseable
,Closeable
,WebSocketSession
- 所有已知实现类:
AbstractHttpSockJsSession
,AbstractSockJsSession
,PollingSockJsSession
,StreamingSockJsSession
,WebSocketServerSockJsSession
public interface SockJsSession extends WebSocketSession
SockJS extension of Spring's standardWebSocketSession
.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
disableHeartbeat()
Disable the SockJS heartbeat, presumably because a higher-level protocol has heartbeats enabled for the session already.long
getTimeSinceLastActive()
Return the time (in ms) since the session was last active, or otherwise if the session is new, then the time since the session was created.从接口继承的方法 org.springframework.web.socket.WebSocketSession
close, close, getAcceptedProtocol, getAttributes, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getId, getLocalAddress, getPrincipal, getRemoteAddress, getTextMessageSizeLimit, getUri, isOpen, sendMessage, setBinaryMessageSizeLimit, setTextMessageSizeLimit
方法详细资料
getTimeSinceLastActive
long getTimeSinceLastActive()
Return the time (in ms) since the session was last active, or otherwise if the session is new, then the time since the session was created.
disableHeartbeat
void disableHeartbeat()
Disable the SockJS heartbeat, presumably because a higher-level protocol has heartbeats enabled for the session already. It is not recommended to disable this otherwise, as it helps proxies to know the connection is not hanging.