aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/ws/WebsocketComponent.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/ws/WebsocketComponent.java')
-rw-r--r--src/main/java/com/juick/ws/WebsocketComponent.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/juick/ws/WebsocketComponent.java b/src/main/java/com/juick/ws/WebsocketComponent.java
index d38f7b69..daf17753 100644
--- a/src/main/java/com/juick/ws/WebsocketComponent.java
+++ b/src/main/java/com/juick/ws/WebsocketComponent.java
@@ -97,7 +97,10 @@ public class WebsocketComponent extends TextWebSocketHandler {
}
}
if (sockSubscr != null) {
- clients.add(sockSubscr);
+ synchronized (clients) {
+ clients.add(sockSubscr);
+ logger.info(clients.size() + " clients connected");
+ }
}
}
@Override
@@ -110,6 +113,7 @@ public class WebsocketComponent extends TextWebSocketHandler {
}
return false;
});
+ logger.info(clients.size() + " clients connected");
}
}