类 StandardWebSocketSession
- java.lang.Object
- org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession<T>
- org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession<Session>
- org.springframework.web.reactive.socket.adapter.StandardWebSocketSession
- 所有已实现的接口:
org.reactivestreams.Subscriber<Void>
,WebSocketSession
- 直接已知子类:
TomcatWebSocketSession
public class StandardWebSocketSession extends AbstractListenerWebSocketSession<Session>
SpringWebSocketSession
adapter for a standard Java (JSR 356)Session
.- 从以下版本开始:
- 5.0
- 作者:
- Violeta Georgieva, Rossen Stoyanchev
嵌套类概要
从类继承的嵌套类/接口 org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession
AbstractListenerWebSocketSession.WebSocketSendProcessor
字段概要
从类继承的字段 org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
logger
构造器概要
构造器 构造器 说明 StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory)
StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory, reactor.core.publisher.MonoProcessor<Void> completionMono)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected boolean
canSuspendReceiving()
Whether the underlying WebSocket API has flow control and can suspend and resume the receiving of messages.reactor.core.publisher.Mono<Void>
close(CloseStatus status)
Close the WebSocket session with the given status.protected void
resumeReceiving()
Resume receiving new message(s) after demand is generated by the downstream Subscriber.protected boolean
sendMessage(WebSocketMessage message)
Send the given WebSocket message.protected void
suspendReceiving()
Suspend receiving until received message(s) are processed and more demand is generated by the downstream Subscriber.从类继承的方法 org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession
getSendProcessor, onComplete, onError, onNext, onSubscribe, receive, send
从类继承的方法 org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession
binaryMessage, bufferFactory, 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
构造器详细资料
StandardWebSocketSession
public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory)
StandardWebSocketSession
public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory, @Nullable reactor.core.publisher.MonoProcessor<Void> completionMono)
方法详细资料
canSuspendReceiving
protected boolean canSuspendReceiving()
从类复制的说明:AbstractListenerWebSocketSession
Whether the underlying WebSocket API has flow control and can suspend and resume the receiving of messages.Note: Sub-classes are encouraged to start out in suspended mode, if possible, and wait until demand is received.
suspendReceiving
protected void suspendReceiving()
从类复制的说明:AbstractListenerWebSocketSession
Suspend receiving until received message(s) are processed and more demand is generated by the downstream Subscriber.Note: if the underlying WebSocket API does not provide flow control for receiving messages, this method should be a no-op and
AbstractListenerWebSocketSession.canSuspendReceiving()
should returnfalse
.
resumeReceiving
protected void resumeReceiving()
从类复制的说明:AbstractListenerWebSocketSession
Resume receiving new message(s) after demand is generated by the downstream Subscriber.Note: if the underlying WebSocket API does not provide flow control for receiving messages, this method should be a no-op and
AbstractListenerWebSocketSession.canSuspendReceiving()
should returnfalse
.
sendMessage
protected boolean sendMessage(WebSocketMessage message) throws IOException
从类复制的说明:AbstractListenerWebSocketSession
Send the given WebSocket message.Note: Sub-classes are responsible for releasing the payload data buffer, once fully written, if pooled buffers apply to the underlying container.
close
public reactor.core.publisher.Mono<Void> close(CloseStatus status)
从接口复制的说明:WebSocketSession
Close the WebSocket session with the given status.- 参数:
status
- the close status