Class XhrClientSockJsSession

java.lang.Object
org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
org.springframework.web.socket.sockjs.client.XhrClientSockJsSession
All Implemented Interfaces:
Closeable, AutoCloseable, WebSocketSession

public class XhrClientSockJsSession extends AbstractClientSockJsSession
An extension of AbstractClientSockJsSession for use with HTTP transports simulating a WebSocket session.
Since:
4.1
Author:
Rossen Stoyanchev
  • Constructor Details

  • Method Details

    • getHeaders

      public HttpHeaders getHeaders()
    • getLocalAddress

      public @Nullable InetSocketAddress getLocalAddress()
      Description copied from interface: WebSocketSession
      Return the address on which the request was received.

      Note: The localAddress is not always possible to access, which is the case with the Standard WebSocket client API, and accordingly StandardWebSocketClient returns null.

    • getRemoteAddress

      public @Nullable InetSocketAddress getRemoteAddress()
      Description copied from interface: WebSocketSession
      Return the address of the remote client.
    • getAcceptedProtocol

      public @Nullable String getAcceptedProtocol()
      Description copied from interface: WebSocketSession
      Return the negotiated sub-protocol.
      Returns:
      the protocol identifier, or null if no protocol was specified or negotiated successfully
    • settextMessageSizeLimit

      public void settextMessageSizeLimit(int messageSizeLimit)
      Description copied from interface: WebSocketSession
      Configure the maximum size for an incoming text message.
    • gettextMessageSizeLimit

      public int gettextMessageSizeLimit()
      Description copied from interface: WebSocketSession
      Get the configured maximum size for an incoming text message.
    • setBinaryMessageSizeLimit

      public void setBinaryMessageSizeLimit(int messageSizeLimit)
      Description copied from interface: WebSocketSession
      Configure the maximum size for an incoming binary message.
    • getBinaryMessageSizeLimit

      public int getBinaryMessageSizeLimit()
      Description copied from interface: WebSocketSession
      Get the configured maximum size for an incoming binary message.
    • getextensions

      public List<WebSocketextension> getextensions()
      Description copied from interface: WebSocketSession
      Determine the negotiated extensions.
      Returns:
      the list of extensions, or an empty list if no extension was specified or negotiated successfully
    • sendInternal

      protected void sendInternal(textMessage message)
      Specified by:
      sendInternal in class AbstractClientSockJsSession
    • disconnect

      protected void disconnect(CloseStatus status)
      Specified by:
      disconnect in class AbstractClientSockJsSession