public class WebSocketClientSockJsSession extends AbstractClientSockJsSession implements NativeWebSocketSession
AbstractClientSockJsSession wrapping and delegating
to an actual WebSocket session.logger| Constructor and Description |
|---|
WebSocketClientSockJsSession(TransportRequest request,
WebSocketHandler handler,
SettableListenableFuture<WebSocketSession> connectFuture) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
afterTransportClosed, close, close, closeInternal, getAttributes, getHandshakeHeaders, getId, getMessageCodec, getPrincipal, getUri, getWebSocketHandler, handleFrame, handleTransportError, isDisconnected, isOpen, sendMessage, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, close, getAttributes, getHandshakeHeaders, getId, getPrincipal, getUri, isOpen, sendMessagepublic WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
public Object getNativeSession()
NativeWebSocketSessiongetNativeSession in interface NativeWebSocketSession@Nullable public <T> T getNativeSession(@Nullable Class<T> requiredType)
NativeWebSocketSessiongetNativeSession in interface NativeWebSocketSessionrequiredType - the required type of the sessionnull if not availablepublic InetSocketAddress getLocalAddress()
WebSocketSessiongetLocalAddress in interface WebSocketSessionpublic InetSocketAddress getRemoteAddress()
WebSocketSessiongetRemoteAddress in interface WebSocketSessionpublic String getAcceptedProtocol()
WebSocketSessiongetAcceptedProtocol in interface WebSocketSessionnull if no protocol
was specified or negotiated successfullypublic void setTextMessageSizeLimit(int messageSizeLimit)
WebSocketSessionsetTextMessageSizeLimit in interface WebSocketSessionpublic int getTextMessageSizeLimit()
WebSocketSessiongetTextMessageSizeLimit in interface WebSocketSessionpublic void setBinaryMessageSizeLimit(int messageSizeLimit)
WebSocketSessionsetBinaryMessageSizeLimit in interface WebSocketSessionpublic int getBinaryMessageSizeLimit()
WebSocketSessiongetBinaryMessageSizeLimit in interface WebSocketSessionpublic List<WebSocketExtension> getExtensions()
WebSocketSessiongetExtensions in interface WebSocketSessionpublic void initializeDelegateSession(WebSocketSession session)
protected void sendInternal(TextMessage textMessage) throws IOException
sendInternal in class AbstractClientSockJsSessionIOExceptionprotected void disconnect(CloseStatus status) throws IOException
disconnect in class AbstractClientSockJsSessionIOException