Class ReactorNetty2WebSocketSession
java.lang.Object
org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<T>
org.springframework.web.reactive.socket.adapter.Netty5WebSocketSessionSupport<ReactorNetty2WebSocketSession.WebSocketConnection>
org.springframework.web.reactive.socket.adapter.ReactorNetty2WebSocketSession
- All Implemented Interfaces:
 WebSocketSession
public class ReactorNetty2WebSocketSession
extends Netty5WebSocketSessionSupport<ReactorNetty2WebSocketSession.WebSocketConnection>
WebSocketSession implementation for use with the Reactor Netty's (Netty 5)
 NettyInbound and NettyOutbound.
 This class is based on ReactorNettyWebSocketSession.- Since:
 - 6.0
 - Author:
 - Violeta Georgieva
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimple container forNettyInboundandNettyOutbound. - 
Field Summary
Fields inherited from class org.springframework.web.reactive.socket.adapter.Netty5WebSocketSessionSupport
DEFAULT_FRAME_MAX_SIZEFields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger - 
Constructor Summary
ConstructorsConstructorDescriptionReactorNetty2WebSocketSession(reactor.netty5.http.websocket.WebsocketInbound inbound, reactor.netty5.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, Netty5DataBufferFactory bufferFactory) Constructor for the session, using theNetty5WebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZEvalue.ReactorNetty2WebSocketSession(reactor.netty5.http.websocket.WebsocketInbound inbound, reactor.netty5.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, Netty5DataBufferFactory bufferFactory, int maxFramePayloadLength) Constructor with an additional maxFramePayloadLength argument. - 
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>close(CloseStatus status) Close the WebSocket session with the given status.reactor.core.publisher.Mono<CloseStatus>Provides access to theCloseStatuswith which the session is closed either locally or remotely, or completes empty if the session ended without a status.io.netty5.channel.ChannelIdReturn the id of the underlying Netty channel.booleanisOpen()Whether the underlying connection is open.reactor.core.publisher.Flux<WebSocketMessage>receive()Provides access to the stream of inbound messages.reactor.core.publisher.Mono<Void>send(Publisher<WebSocketMessage> messages) Give a source of outgoing messages, write the messages and return aMono<Void>that completes when the source completes and writing is done.Methods inherited from class org.springframework.web.reactive.socket.adapter.Netty5WebSocketSessionSupport
bufferFactory, toFrame, toMessageMethods inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
binaryMessage, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, 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 
- 
Constructor Details
- 
ReactorNetty2WebSocketSession
public ReactorNetty2WebSocketSession(reactor.netty5.http.websocket.WebsocketInbound inbound, reactor.netty5.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, Netty5DataBufferFactory bufferFactory) Constructor for the session, using theNetty5WebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZEvalue. - 
ReactorNetty2WebSocketSession
public ReactorNetty2WebSocketSession(reactor.netty5.http.websocket.WebsocketInbound inbound, reactor.netty5.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, Netty5DataBufferFactory bufferFactory, int maxFramePayloadLength) Constructor with an additional maxFramePayloadLength argument.- Since:
 - 5.1
 
 
 - 
 - 
Method Details
- 
getChannelId
public io.netty5.channel.ChannelId getChannelId()Return the id of the underlying Netty channel.- Since:
 - 5.3.4
 
 - 
receive
Description copied from interface:WebSocketSessionProvides access to the stream of inbound messages.This stream receives a completion or error signal when the connection is closed. In a typical
WebSocketHandlerimplementation this stream is composed into the overall processing flow, so that when the connection is closed, handling will end.See the class-level doc of
WebSocketHandlerand the reference for more details and examples of how to handle the session.- Specified by:
 receivein interfaceWebSocketSession- Specified by:
 receivein classAbstractWebSocketSession<ReactorNetty2WebSocketSession.WebSocketConnection>
 - 
send
Description copied from interface:WebSocketSessionGive a source of outgoing messages, write the messages and return aMono<Void>that completes when the source completes and writing is done.See the class-level doc of
WebSocketHandlerand the reference for more details and examples of how to handle the session.- Specified by:
 sendin interfaceWebSocketSession- Specified by:
 sendin classAbstractWebSocketSession<ReactorNetty2WebSocketSession.WebSocketConnection>
 - 
isOpen
public boolean isOpen()Description copied from interface:WebSocketSessionWhether the underlying connection is open. - 
close
Description copied from interface:WebSocketSessionClose the WebSocket session with the given status.- Parameters:
 status- the close status
 - 
closeStatus
Description copied from interface:WebSocketSessionProvides access to theCloseStatuswith which the session is closed either locally or remotely, or completes empty if the session ended without a status. 
 -