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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, close, getAttributes, getHandshakeHeaders, getId, getPrincipal, getUri, isOpen, sendMessage
public WebSocketClientSockJsSession(TransportRequest request, WebSocketHandler handler, SettableListenableFuture<WebSocketSession> connectFuture)
public Object getNativeSession()
NativeWebSocketSession
getNativeSession
in interface NativeWebSocketSession
public <T> T getNativeSession(Class<T> requiredType)
NativeWebSocketSession
getNativeSession
in interface NativeWebSocketSession
requiredType
- the required type of the sessionnull
if not availablepublic InetSocketAddress getLocalAddress()
WebSocketSession
getLocalAddress
in interface WebSocketSession
public InetSocketAddress getRemoteAddress()
WebSocketSession
getRemoteAddress
in interface WebSocketSession
public String getAcceptedProtocol()
WebSocketSession
getAcceptedProtocol
in interface WebSocketSession
null
if no protocol
was specified or negotiated successfullypublic void setTextMessageSizeLimit(int messageSizeLimit)
WebSocketSession
setTextMessageSizeLimit
in interface WebSocketSession
public int getTextMessageSizeLimit()
WebSocketSession
getTextMessageSizeLimit
in interface WebSocketSession
public void setBinaryMessageSizeLimit(int messageSizeLimit)
WebSocketSession
setBinaryMessageSizeLimit
in interface WebSocketSession
public int getBinaryMessageSizeLimit()
WebSocketSession
getBinaryMessageSizeLimit
in interface WebSocketSession
public List<WebSocketExtension> getExtensions()
WebSocketSession
getExtensions
in interface WebSocketSession
public void initializeDelegateSession(WebSocketSession session)
protected void sendInternal(TextMessage textMessage) throws IOException
sendInternal
in class AbstractClientSockJsSession
IOException
protected void disconnect(CloseStatus status) throws IOException
disconnect
in class AbstractClientSockJsSession
IOException