Skip to content

Commit

Permalink
Merge pull request #1013 from bigtian99/dev
Browse files Browse the repository at this point in the history
fix(namespace): prevents the client from repeatedly connecting to the namespace
  • Loading branch information
mrniko authored Oct 31, 2024
2 parents 0238b47 + 969d444 commit 0e26a4d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down

0 comments on commit 0e26a4d

Please sign in to comment.