org.springframework.web.reactive.socket.adapter

## Class TomcatWebSocketSession

- 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.springframework.web.reactive.socket.adapter.TomcatWebSocketSession

All Implemented Interfaces:
  org.reactivestreams.Subscriber<Void>, WebSocketSession

    public class TomcatWebSocketSession
    extends StandardWebSocketSession

Spring `WebSocketSession` adapter for Tomcat's `Session`.

Since:
  5.0
Author:
  Violeta Georgieva

### Nested Class Summary

### Nested classes/interfaces inherited from class org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession

`AbstractListenerWebSocketSession.WebSocketSendProcessor`

### Field Summary

### Fields inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession

`logger`

### Constructor Summary

Constructors
Constructor and Description
`TomcatWebSocketSession(Session session, HandshakeInfo info, org.springframework.core.io.buffer.DataBufferFactory factory)`
`TomcatWebSocketSession(Session session, HandshakeInfo info, org.springframework.core.io.buffer.DataBufferFactory factory, reactor.core.publisher.MonoProcessor<Void> completionMono)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `canSuspendReceiving()` Whether the underlying WebSocket API has flow control and can suspend and resume the receiving of messages.
`protected void` `resumeReceiving()` Resume receiving new message(s) after demand is generated by the downstream Subscriber.
`protected void` `suspendReceiving()` Suspend receiving until received message(s) are processed and more demand is generated by the downstream Subscriber.

### Methods inherited from class org.springframework.web.reactive.socket.adapter.StandardWebSocketSession

`close, sendMessage`

### Methods inherited from class org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession

`getSendProcessor, onComplete, onError, onNext, onSubscribe, receive, send`

### Methods inherited from class org.springframework.web.reactive.socket.adapter.AbstractWebSocketSession

`binaryMessage, bufferFactory, getAttributes, getDelegate, getHandshakeInfo, getId, getLogPrefix, pingMessage, pongMessage, textMessage, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.reactive.socket.WebSocketSession

`close`

### Constructor Detail

#### TomcatWebSocketSession

    public TomcatWebSocketSession(Session session,
                                  HandshakeInfo info,
                                  org.springframework.core.io.buffer.DataBufferFactory factory)

#### TomcatWebSocketSession

    public TomcatWebSocketSession(Session session,
                                  HandshakeInfo info,
                                  org.springframework.core.io.buffer.DataBufferFactory factory,
                                  reactor.core.publisher.MonoProcessor<Void> completionMono)

### Method Detail

#### canSuspendReceiving

    protected boolean canSuspendReceiving()

Description copied from class: `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.

Overrides:
  `canSuspendReceiving` in class `StandardWebSocketSession`

#### suspendReceiving

    protected void suspendReceiving()

Description copied from class: `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 return `false`.

Overrides:
  `suspendReceiving` in class `StandardWebSocketSession`

#### resumeReceiving

    protected void resumeReceiving()

Description copied from class: `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 return `false`.

Overrides:
  `resumeReceiving` in class `StandardWebSocketSession`