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-based WebSocketSession adapters that provides convenience methods to convert Netty WebSocketFrames to and from WebSocketMessages.
Since:
5.0
Author:
Rossen Stoyanchev
  • Field Details

    • DEFAULT_FRAME_MAX_SIZE

      public static final int DEFAULT_FRAME_MAX_SIZE
      The default max size for inbound WebSocket frames.
      See Also:
  • Constructor Details

    • NettyWebSocketSessionSupport

      protected NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, org.springframework.core.io.buffer.NettyDataBufferFactory factory)
  • Method Details

    • bufferFactory

      public org.springframework.core.io.buffer.NettyDataBufferFactory bufferFactory()
      Description copied from interface: WebSocketSession
      Return a DataBuffer Factory to create message payloads.
      Specified by:
      bufferFactory in interface WebSocketSession
      Overrides:
      bufferFactory in class AbstractWebSocketSession<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)