Class NettyWebSocketSessionSupport<T>
java.lang.Object
org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<T>
org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport<T>
- Type Parameters:
T- the native delegate type
- All Implemented Interfaces:
WebSocketSession
- Direct Known Subclasses:
ReactorNettyWebSocketSession
Base class for Netty-based
WebSocketSession adapters that provides
convenience methods to convert Netty WebSocketFrames to and from
WebSocketMessages.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default max size for inbound WebSocket frames.Fields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNettyWebSocketSessionSupport(T delegate, String id, HandshakeInfo info, NettyDataBufferFactory factory) Variant ofNettyWebSocketSessionSupport(Object, HandshakeInfo, NettyDataBufferFactory)with a given WebSocket session id.protectedNettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory) Constructor that uses the hashcode of the delegate as the session id. -
Method Summary
Modifier and TypeMethodDescriptionReturn aDataBufferFactory to create message payloads.protected io.netty.handler.codec.http.websocketx.WebSocketFrametoFrame(WebSocketMessage message) protected WebSocketMessagetoMessage(io.netty.handler.codec.http.websocketx.WebSocketFrame frame) Methods inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
binaryMessage, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, receive, send, textMessage, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.web.reactive.socket.WebSocketSession
close, close, closeStatus, isOpen
-
Field Details
-
DEFAULT_FRAME_MAX_SIZE
public static final int DEFAULT_FRAME_MAX_SIZEThe default max size for inbound WebSocket frames.- See Also:
-
-
Constructor Details
-
NettyWebSocketSessionSupport
protected NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory) Constructor that uses the hashcode of the delegate as the session id. -
NettyWebSocketSessionSupport
protected NettyWebSocketSessionSupport(T delegate, String id, HandshakeInfo info, NettyDataBufferFactory factory) Variant ofNettyWebSocketSessionSupport(Object, HandshakeInfo, NettyDataBufferFactory)with a given WebSocket session id.- Since:
- 6.2.15
-
-
Method Details
-
bufferFactory
Description copied from interface:WebSocketSessionReturn aDataBufferFactory to create message payloads.- Specified by:
bufferFactoryin interfaceWebSocketSession- Overrides:
bufferFactoryin classAbstractWebSocketSession<T>- Returns:
- the buffer factory for the session
-
toMessage
-
toFrame
-