public class ReactorNettyWebSocketSession extends NettyWebSocketSessionSupport<ReactorNettyWebSocketSession.WebSocketConnection>
Modifier and Type | Class and Description |
---|---|
static class |
ReactorNettyWebSocketSession.WebSocketConnection
Simple container for
NettyInbound and NettyOutbound . |
DEFAULT_FRAME_MAX_SIZE
logger
Constructor and Description |
---|
ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound,
reactor.netty.http.websocket.WebsocketOutbound outbound,
HandshakeInfo info,
NettyDataBufferFactory bufferFactory)
Constructor for the session, using the
NettyWebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZE value. |
ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound,
reactor.netty.http.websocket.WebsocketOutbound outbound,
HandshakeInfo info,
NettyDataBufferFactory bufferFactory,
int maxFramePayloadLength)
Constructor with an additional maxFramePayloadLength argument.
|
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Void> |
close(CloseStatus status)
Close the WebSocket session with the given status.
|
reactor.core.publisher.Flux<WebSocketMessage> |
receive()
Provides access to the stream of inbound messages.
|
reactor.core.publisher.Mono<Void> |
send(org.reactivestreams.Publisher<WebSocketMessage> messages)
Give a source of outgoing messages, write the messages and return a
Mono<Void> that completes when the source completes and writing
is done. |
bufferFactory, toFrame, toMessage
binaryMessage, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, textMessage, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close
public ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound, reactor.netty.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, NettyDataBufferFactory bufferFactory)
NettyWebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZE
value.public ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound, reactor.netty.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, NettyDataBufferFactory bufferFactory, int maxFramePayloadLength)
public reactor.core.publisher.Flux<WebSocketMessage> receive()
WebSocketSession
This stream receives a completion or error signal when the connection
is closed. In a typical WebSocketHandler
implementation 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 WebSocketHandler
and the reference
for more details and examples of how to handle the session.
receive
in interface WebSocketSession
receive
in class AbstractWebSocketSession<ReactorNettyWebSocketSession.WebSocketConnection>
public reactor.core.publisher.Mono<Void> send(org.reactivestreams.Publisher<WebSocketMessage> messages)
WebSocketSession
Mono<Void>
that completes when the source completes and writing
is done.
See the class-level doc of WebSocketHandler
and the reference
for more details and examples of how to handle the session.
send
in interface WebSocketSession
send
in class AbstractWebSocketSession<ReactorNettyWebSocketSession.WebSocketConnection>
public reactor.core.publisher.Mono<Void> close(CloseStatus status)
WebSocketSession
status
- the close status