类 WebSocketClientSockJsSession
- java.lang.Object
- org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
- org.springframework.web.socket.sockjs.client.WebSocketClientSockJsSession
- 所有已实现的接口:
Closeable
,AutoCloseable
,NativeWebSocketSession
,WebSocketSession
public class WebSocketClientSockJsSession extends AbstractClientSockJsSession implements NativeWebSocketSession
An extension ofAbstractClientSockJsSession
wrapping and delegating to an actual WebSocket session.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession
logger
构造器概要
构造器 构造器 说明 WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, 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.InetSocketAddress
getLocalAddress()
Return the address on which the request was received.Object
getNativeSession()
Return the underlying native WebSocketSession.<T> T
getNativeSession(Class<T> requiredType)
Return the underlying native WebSocketSession, if available.InetSocketAddress
getRemoteAddress()
Return the address of the remote client.int
getTextMessageSizeLimit()
Get the configured maximum size for an incoming text message.void
initializeDelegateSession(WebSocketSession session)
protected void
sendInternal(TextMessage textMessage)
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
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.web.socket.WebSocketSession
close, close, getAttributes, getHandshakeHeaders, getId, getPrincipal, getUri, isOpen, sendMessage
构造器详细资料
WebSocketClientSockJsSession
public WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
方法详细资料
getNativeSession
public Object getNativeSession()
从接口复制的说明:NativeWebSocketSession
Return the underlying native WebSocketSession.- 指定者:
getNativeSession
在接口中NativeWebSocketSession
getNativeSession
public <T> T getNativeSession(Class<T> requiredType)
从接口复制的说明:NativeWebSocketSession
Return the underlying native WebSocketSession, if available.- 指定者:
getNativeSession
在接口中NativeWebSocketSession
- 参数:
requiredType
- the required type of the session- 返回:
- the native session of the required type, or
null
if not available
getLocalAddress
public InetSocketAddress getLocalAddress()
从接口复制的说明:WebSocketSession
Return the address on which the request was received.- 指定者:
getLocalAddress
在接口中WebSocketSession
getRemoteAddress
public InetSocketAddress getRemoteAddress()
从接口复制的说明:WebSocketSession
Return the address of the remote client.- 指定者:
getRemoteAddress
在接口中WebSocketSession
getAcceptedProtocol
public String getAcceptedProtocol()
从接口复制的说明:WebSocketSession
Return the negotiated sub-protocol.- 指定者:
getAcceptedProtocol
在接口中WebSocketSession
- 返回:
- 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.- 指定者:
setTextMessageSizeLimit
在接口中WebSocketSession
getTextMessageSizeLimit
public int getTextMessageSizeLimit()
从接口复制的说明:WebSocketSession
Get the configured maximum size for an incoming text message.- 指定者:
getTextMessageSizeLimit
在接口中WebSocketSession
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.- 指定者:
getExtensions
在接口中WebSocketSession
- 返回:
- the list of extensions, or an empty list if no extension was specified or negotiated successfully
initializeDelegateSession
public void initializeDelegateSession(WebSocketSession session)
sendInternal
protected void sendInternal(TextMessage textMessage) throws IOException
disconnect
protected void disconnect(CloseStatus status) throws IOException
- 指定者:
disconnect
在类中AbstractClientSockJsSession
- 抛出:
IOException