Add CloseStatus to indicate unreliable session

When a send timeout is detected, the WebSocket session is now closed
with a custom close status that indicates so. This allows skipping
parts of the close logic that may cause further hanging.

Issue: SPR-11450
This commit is contained in:
Rossen Stoyanchev
2014-03-23 00:51:33 -04:00
parent 4028a3b0bc
commit cbd5af3a03
6 changed files with 64 additions and 22 deletions

View File

@@ -17,6 +17,7 @@
package org.springframework.web.socket.handler;
import org.junit.Test;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketMessage;
@@ -136,6 +137,7 @@ public class ConcurrentWebSocketSessionDecoratorTests {
fail("Expected exception");
}
catch (SessionLimitExceededException ex) {
assertEquals(CloseStatus.SESSION_NOT_RELIABLE, ex.getStatus());
}
}