类 XhrClientSockJsSession
- java.lang.Object
- org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
- org.springframework.web.socket.sockjs.client.XhrClientSockJsSession
- 所有已实现的接口:
Closeable,AutoCloseable,WebSocketSession
public class XhrClientSockJsSession extends AbstractClientSockJsSession
An extension ofAbstractClientSockJsSessionfor use with HTTP transports simulating a WebSocket session.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
logger
构造器概要
构造器 构造器 说明 XhrClientSockJsSession(TransportRequest request, WebSocketHandler handler, XhrTransport transport, SettableListenableFuture<WebSocketSession> connectFuture)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voiddisconnect(CloseStatus status)StringgetAcceptedProtocol()Return the negotiated sub-protocol.intgetBinaryMessageSizeLimit()Get the configured maximum size for an incoming binary message.List<WebSocketExtension>getExtensions()Determine the negotiated extensions.HttpHeadersgetHeaders()InetSocketAddressgetLocalAddress()Return the address on which the request was received.InetSocketAddressgetRemoteAddress()Return the address of the remote client.intgetTextMessageSizeLimit()Get the configured maximum size for an incoming text message.protected voidsendInternal(TextMessage message)voidsetBinaryMessageSizeLimit(int messageSizeLimit)Configure the maximum size for an incoming binary message.voidsetTextMessageSizeLimit(int messageSizeLimit)Configure the maximum size for an incoming text message.从类继承的方法 org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
afterTransportClosed, close, close, closeInternal, getAttributes, getHandshakeHeaders, getId, getMessageCodec, getPrincipal, getUri, getWebSocketHandler, handleFrame, handleTransportError, isDisconnected, isOpen, sendMessage, toString
构造器详细资料
XhrClientSockJsSession
public XhrClientSockJsSession(TransportRequest request, WebSocketHandler handler, XhrTransport transport, SettableListenableFuture<WebSocketSession> connectFuture)
方法详细资料
getHeaders
public HttpHeaders getHeaders()
getLocalAddress
public InetSocketAddress getLocalAddress()
从接口复制的说明:WebSocketSessionReturn the address on which the request was received.
getRemoteAddress
public InetSocketAddress getRemoteAddress()
从接口复制的说明:WebSocketSessionReturn the address of the remote client.
getAcceptedProtocol
public String getAcceptedProtocol()
从接口复制的说明:WebSocketSessionReturn the negotiated sub-protocol.- 返回:
- the protocol identifier, or
nullif no protocol was specified or negotiated successfully
setTextMessageSizeLimit
public void setTextMessageSizeLimit(int messageSizeLimit)
从接口复制的说明:WebSocketSessionConfigure the maximum size for an incoming text message.
getTextMessageSizeLimit
public int getTextMessageSizeLimit()
从接口复制的说明:WebSocketSessionGet the configured maximum size for an incoming text message.
setBinaryMessageSizeLimit
public void setBinaryMessageSizeLimit(int messageSizeLimit)
从接口复制的说明:WebSocketSessionConfigure the maximum size for an incoming binary message.
getBinaryMessageSizeLimit
public int getBinaryMessageSizeLimit()
从接口复制的说明:WebSocketSessionGet the configured maximum size for an incoming binary message.
getExtensions
public List<WebSocketExtension> getExtensions()
从接口复制的说明:WebSocketSessionDetermine the negotiated extensions.- 返回:
- the list of extensions, or an empty list if no extension was specified or negotiated successfully
sendInternal
protected void sendInternal(TextMessage message)
disconnect
protected void disconnect(CloseStatus status)