类 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 ofAbstractClientSockJsSession
for 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 void
disconnect(CloseStatus status)
String
getAcceptedProtocol()
Return the negotiated sub-protocol.int
getBinaryMessageSizeLimit()
Get the configured maximum size for an incoming binary message.List<WebSocketExtension>
getExtensions()
Determine the negotiated extensions.HttpHeaders
getHeaders()
InetSocketAddress
getLocalAddress()
Return the address on which the request was received.InetSocketAddress
getRemoteAddress()
Return the address of the remote client.int
getTextMessageSizeLimit()
Get the configured maximum size for an incoming text message.protected void
sendInternal(TextMessage message)
void
setBinaryMessageSizeLimit(int messageSizeLimit)
Configure the maximum size for an incoming binary message.void
setTextMessageSizeLimit(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()
从接口复制的说明:WebSocketSession
Return the address on which the request was received.
getRemoteAddress
public InetSocketAddress getRemoteAddress()
从接口复制的说明:WebSocketSession
Return the address of the remote client.
getAcceptedProtocol
public String getAcceptedProtocol()
从接口复制的说明:WebSocketSession
Return the negotiated sub-protocol.- 返回:
- the protocol identifier, or
null
if no protocol was specified or negotiated successfully
setTextMessageSizeLimit
public void setTextMessageSizeLimit(int messageSizeLimit)
从接口复制的说明:WebSocketSession
Configure the maximum size for an incoming text message.
getTextMessageSizeLimit
public int getTextMessageSizeLimit()
从接口复制的说明:WebSocketSession
Get the configured maximum size for an incoming text message.
setBinaryMessageSizeLimit
public void setBinaryMessageSizeLimit(int messageSizeLimit)
从接口复制的说明:WebSocketSession
Configure the maximum size for an incoming binary message.
getBinaryMessageSizeLimit
public int getBinaryMessageSizeLimit()
从接口复制的说明:WebSocketSession
Get the configured maximum size for an incoming binary message.
getExtensions
public List<WebSocketExtension> getExtensions()
从接口复制的说明:WebSocketSession
Determine 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)