aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-10 14:42:13 +0300
committerGravatar Vitaly Takmazov2018-04-10 14:42:13 +0300
commitc875f208a6af4bf676022cd4b55b5c9624141a78 (patch)
treea8675ebcbf854f8e6a396164f2100fee2c8f9a94 /juick-server/src/main/java/com
parent4d8842d3254886b1925015e0cd24005dd927dd2a (diff)
websocket: do not ping closed sessions
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r--juick-server/src/main/java/com/juick/server/WebsocketManager.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/WebsocketManager.java b/juick-server/src/main/java/com/juick/server/WebsocketManager.java
index f55bd92b..4beb3190 100644
--- a/juick-server/src/main/java/com/juick/server/WebsocketManager.java
+++ b/juick-server/src/main/java/com/juick/server/WebsocketManager.java
@@ -166,7 +166,9 @@ public class WebsocketManager extends TextWebSocketHandler {
public void ping() {
clients.forEach(c -> {
try {
- c.session.sendMessage(new PingMessage());
+ if (c.session.isOpen()) {
+ c.session.sendMessage(new PingMessage());
+ }
} catch (IOException e) {
logger.error("WebSocket PING exception", e);
}