How do I get the number of connections in the session?

The session object dispatches a connectionCreated event for each client connected to the session. To count the number of connections in the session,create a variable called numberofConnections and initialize it to zero. Listen to the "connectionCreated" event and increment the variable numberofConnections inside the event handler. The value of this variable then gives you the number of clients connected to the session at any instant of time.

Have more questions? Submit a request