diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java index 9016c3e830..19e6b01913 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java @@ -120,6 +120,13 @@ public interface WebSocketSession extends Closeable { /** * Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}. + * + *
Note: 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;
diff --git a/src/docs/asciidoc/web/websocket.adoc b/src/docs/asciidoc/web/websocket.adoc
index 25eb5b3589..fe117eb209 100644
--- a/src/docs/asciidoc/web/websocket.adoc
+++ b/src/docs/asciidoc/web/websocket.adoc
@@ -102,12 +102,18 @@ The following example shows the XML configuration equivalent of the preceding ex
----
====
-The pereceding example is for use in Spring MVC applications and should be included in the
+The preceding example is for use in Spring MVC applications and should be included in the
configuration of a <