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