org.springframework.web.reactive.socket.adapter

## 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 Summary

Fields
`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
`protected` `NettyWebSocketSessionSupport(T delegate, HandshakeInfo info, org.springframework.core.io.buffer.NettyDataBufferFactory factory)`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.springframework.core.io.buffer.NettyDataBufferFactory` `bufferFactory()` Return a `DataBuffer` 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,
                                           org.springframework.core.io.buffer.NettyDataBufferFactory factory)

### Method Detail

#### 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)