Add reference to ConcurrentWebSocketSessionDecorator in the docs.

Issue: SPR-12886
This commit is contained in:
Rossen Stoyanchev
2018-12-12 11:57:51 -05:00
parent 388ce92861
commit 14e87d2733
2 changed files with 14 additions and 1 deletions

View File

@@ -120,6 +120,13 @@ public interface WebSocketSession extends Closeable {
/**
* Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}.
*
* <p><strong>Note:</strong> The underlying standard WebSocket session (JSR-356) does
* not allow concurrent sending. Therefore sending must be synchronized. To ensure
* that, one option is to wrap the {@code WebSocketSession} with the
* {@link org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
* ConcurrentWebSocketSessionDecorator}.
* @see org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
*/
void sendMessage(WebSocketMessage<?> message) throws IOException;