Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Count subscribe Client #74

Open
websenornarendra opened this issue Feb 26, 2019 · 1 comment
Open

Count subscribe Client #74

websenornarendra opened this issue Feb 26, 2019 · 1 comment

Comments

@websenornarendra
Copy link

It is possible that we can count client in a room

Ex.
We have Chat Room with Different Topic
And Many Clients subscribe Different Topic

When Client subscribe Any Topic then Count subscribed Client

it is possible

@edge-rps
Copy link

At the top of your socket.js or WS Controller
var user_count = 0;

when a user joins or disconnects
user_count++ or user_count--

and you can emit that variable
socket.emit('users', user_count)

@thetutlage thetutlage removed the triage label Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants