类 ReactorNettyWebSocketSession
- java.lang.Object
- org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<T>
- org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport<ReactorNettyWebSocketSession.WebSocketConnection>
- org.springframework.web.reactive.socket.adapter.ReactorNettyWebSocketSession
- 所有已实现的接口:
WebSocketSession
public class ReactorNettyWebSocketSession extends NettyWebSocketSessionSupport<ReactorNettyWebSocketSession.WebSocketConnection>
- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
ReactorNettyWebSocketSession.WebSocketConnection
Simple container forNettyInbound
andNettyOutbound
.
字段概要
从类继承的字段 org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport
DEFAULT_FRAME_MAX_SIZE
从类继承的字段 org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger
构造器概要
构造器 构造器 说明 ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound, reactor.netty.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, NettyDataBufferFactory bufferFactory)
Constructor for the session, using theNettyWebSocketSessionSupport.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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 aMono<Void>
that completes when the source completes and writing is done.从类继承的方法 org.springframework.web.reactive.socket.adapter.NettyWebSocketSessionSupport
bufferFactory, toFrame, toMessage
从类继承的方法 org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
binaryMessage, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, textMessage, toString
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.web.reactive.socket.WebSocketSession
close
构造器详细资料
ReactorNettyWebSocketSession
public ReactorNettyWebSocketSession(reactor.netty.http.websocket.WebsocketInbound inbound, reactor.netty.http.websocket.WebsocketOutbound outbound, HandshakeInfo info, NettyDataBufferFactory bufferFactory)
Constructor for the session, using theNettyWebSocketSessionSupport.DEFAULT_FRAME_MAX_SIZE
value.
ReactorNettyWebSocketSession
public 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.- 从以下版本开始:
- 5.1
方法详细资料
receive
public reactor.core.publisher.Flux<WebSocketMessage> receive()
从接口复制的说明:WebSocketSession
Provides access to the stream of inbound messages.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.
send
public reactor.core.publisher.Mono<Void> send(org.reactivestreams.Publisher<WebSocketMessage> messages)
从接口复制的说明:WebSocketSession
Give 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
WebSocketHandler
and the reference for more details and examples of how to handle the session.
close
public reactor.core.publisher.Mono<Void> close(CloseStatus status)
从接口复制的说明:WebSocketSession
Close the WebSocket session with the given status.- 参数:
status
- the close status