diff options
author | Vitaly Takmazov | 2016-06-28 14:53:37 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-06-28 14:53:37 +0300 |
commit | f53538d230440f16948a12a34ffe587edcd0f245 (patch) | |
tree | 8e32f76206d5c87be5872aba1bad410733c2b592 | |
parent | 9f2503cf924d79f00cb0956d37daf10e7a163163 (diff) |
fixes
-rw-r--r-- | src/main/java/com/juick/ws/WebsocketComponent.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/juick/ws/WebsocketComponent.java b/src/main/java/com/juick/ws/WebsocketComponent.java index 83e811a6..7399c298 100644 --- a/src/main/java/com/juick/ws/WebsocketComponent.java +++ b/src/main/java/com/juick/ws/WebsocketComponent.java @@ -97,19 +97,18 @@ public class WebsocketComponent extends TextWebSocketHandler { } } if (sockSubscr != null) { - synchronized (clients) { - clients.add(sockSubscr); - } + clients.add(sockSubscr); } } @Override public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception { synchronized (clients) { - clients.stream().filter(c -> c.session.equals(session)).forEach(c -> { + clients.stream().filter(c -> c.session.getId().equals(session.getId())).forEach(c -> { logger.info(String.format("session %s closed with status %s", c.clientName, status.getCode())); clients.remove(c); }); } + } class SocketSubscribed { |