- Notifications
You must be signed in to change notification settings - Fork10.1k
-
I have a socket.io server with multiple namespace and i want count how many client are connected to the current server. With socket.io v2 I count the connection with this snippet it works for the V2. Now, i have upgraded to v3 and socket.io has made a breaking change, fromdocs.:
How i can retrive the total number of client connected to my server with the V3? A workaround is access to but in typescript clientsCount in engine is marked as private property. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 1 reply
-
That's a good question actually. If you only use the main namespace, you can use If the clients are not always connected to the main namespace, you can indeed use |
BetaWas this translation helpful?Give feedback.
All reactions
-
I have multiple namespace... io.engine.clientsCount seem the best option and I think it's a good idea make engine a bublic property. Eg. in my case have a "clientsCount" for server istance is important due to make a load balancing strategy. |
BetaWas this translation helpful?Give feedback.
All reactions
-
We Didn't Just Build It — We Solved What the Industry Couldn't Issue Description StatusTensorFlow #35177 GPU memory not released after tf.Session ✅ SolvedReact #22114 Suspense fallback memory leak ✅ SolvedSocket.IO#3756 WebSocket closes when using multiple namespaces ✅ Solved All via CollapseEngine’s cross-layer cognitive tracing — no brute force, no guesswork. |
BetaWas this translation helpful?Give feedback.