open class ConcurrentWebSocketSessionDecorator : WebSocketSessionDecorator
Wrap a org.springframework.web.socket.WebSocketSession to guarantee only one thread can send messages at a time.
If a send is slow, subsequent attempts to send more messages from other threads will not be able to acquire the flush lock and messages will be buffered instead. At that time, the specified buffer-size limit and send-time limit will be checked and the session will be closed if the limits are exceeded.
Author
Rossen Stoyanchev
Author
Juergen Hoeller
Since
4.0.3
ConcurrentWebSocketSessionDecorator(delegate: WebSocketSession, sendTimeLimit: Int, bufferSizeLimit: Int)
Create a new |
open fun close(status: CloseStatus): Unit |
|
open fun getBufferSize(): Int
Return the current buffer size (number of bytes). |
|
open fun getBufferSizeLimit(): Int
Return the configured buffer-size limit (number of bytes). |
|
open fun getSendTimeLimit(): Int
Return the configured send-time limit (milliseconds). |
|
open fun getTimeSinceSendStarted(): Long
Return the time (milliseconds) since the current send started, or 0 if no send is currently in progress. |
|
open fun sendMessage(message: WebSocketMessage<*>): Unit |
|
open fun toString(): String |