类 AbstractListenerWebSocketSession<T>

    • 方法详细资料

      • receive

        public reactor.core.publisher.Flux<WebSocketMessagereceive()
        从接口复制的说明: 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.

        指定者:
        receive 在接口中 WebSocketSession
        指定者:
        receive 在类中 AbstractWebSocketSession<T>
      • canSuspendReceiving

        protected abstract boolean canSuspendReceiving()
        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 abstract void suspendReceiving()
        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 canSuspendReceiving() should return false.

      • resumeReceiving

        protected abstract void resumeReceiving()
        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 canSuspendReceiving() should return false.

      • sendMessage

        protected abstract boolean sendMessage​(WebSocketMessage message)
                                        throws IOException
        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.

        抛出:
        IOException
      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription subscription)
        指定者:
        onSubscribe 在接口中 org.reactivestreams.Subscriber<T>
      • onNext

        public void onNext​(Void aVoid)
        指定者:
        onNext 在接口中 org.reactivestreams.Subscriber<T>
      • onError

        public void onError​(Throwable ex)
        指定者:
        onError 在接口中 org.reactivestreams.Subscriber<T>
      • onComplete

        public void onComplete()
        指定者:
        onComplete 在接口中 org.reactivestreams.Subscriber<T>