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
public abstract class NettyWebSocketSessionSupport<T> extends AbstractWebSocketSession<T>
Base class for Netty-basedWebSocketSession
adapters that provides convenience methods to convert NettyWebSocketFrames
to and fromWebSocketMessages
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_FRAME_MAX_SIZE
The default max size for inbound WebSocket frames.Fields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger
Constructor Summary
Constructors Modifier Constructor Description protected
NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NettyDataBufferFactory
bufferFactory()
Return aDataBuffer
Factory to create message payloads.protected io.netty.handler.codec.http.websocketx.WebSocketFrame
toFrame(WebSocketMessage message)
protected WebSocketMessage
toMessage(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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.reactive.socket.WebSocketSession
close, close
Field Detail
DEFAULT_FRAME_MAX_SIZE
public static final int DEFAULT_FRAME_MAX_SIZE
The default max size for inbound WebSocket frames.- See Also:
- Constant Field Values
Constructor Detail
NettyWebSocketSessionSupport
protected NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, NettyDataBufferFactory factory)
Method Detail
bufferFactory
public NettyDataBufferFactory bufferFactory()
Description copied from interface:WebSocketSession
Return aDataBuffer
Factory to create message payloads.- Specified by:
bufferFactory
in interfaceWebSocketSession
- Overrides:
bufferFactory
in classAbstractWebSocketSession<T>
- Returns:
- the buffer factory for the session
toMessage
protected WebSocketMessage toMessage(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
toFrame
protected io.netty.handler.codec.http.websocketx.WebSocketFrame toFrame(WebSocketMessage message)