diff --git a/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java b/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java index cb5e9842..cd78123c 100644 --- a/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java +++ b/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java @@ -200,6 +200,11 @@ public void addConnectListener(ConnectListener listener) { } public void onConnect(SocketIOClient client) { + if (roomClients.containsKey(getName()) && + roomClients.get(getName()).contains(client.getSessionId())) { + return; + } + join(getName(), client.getSessionId()); storeFactory.pubSubStore().publish(PubSubType.JOIN, new JoinLeaveMessage(client.getSessionId(), getName(), getName()));