org.springframework.web.socket.sockjs.transport

## Interface SockJsSession

- All Superinterfaces:
    WebSocketSession
  All Known Implementing Classes:
    AbstractHttpSockJsSession, AbstractSockJsSession, PollingSockJsSession, StreamingSockJsSession, WebSocketServerSockJsSession

      public interface SockJsSession
      extends WebSocketSession

  SockJS extension of Spring's standard `WebSocketSession`.
  Since:
    4.0
  Author:
    Juergen Hoeller, Rossen Stoyanchev

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `disableHeartbeat()` Disable SockJS heartbeat, presumably because a higher level protocol has heartbeats enabled for the session.
    `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.

    - ### Methods inherited from interface org.springframework.web.socket.WebSocketSession

      `close, close, getAcceptedProtocol, getAttributes, getBinaryMessageSizeLimit, getExtensions, getHandshakeHeaders, getId, getLocalAddress, getPrincipal, getRemoteAddress, getTextMessageSizeLimit, getUri, isOpen, sendMessage, setBinaryMessageSizeLimit, setTextMessageSizeLimit`

- - ### Method Detail

    - #### 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 SockJS heartbeat, presumably because a higher level protocol has heartbeats enabled for the session. It is not recommended to disable this otherwise as it helps proxies to know the connection is not hanging.