Skip to content

Count of connected clients/sockets #463

Closed
@denisu

Description

@denisu

Hi,

I am using io.sockets.clients().length to get the count of all currently connected clients, but after some time this number is way to high, many disconnected clients are still present in this array.

Below an image of io.sockets.clients().length, plotted every 5 minutes for 24 hours. Once the count reached over ~2k, i restarted the server, about 200 to 300 clients reconnected, which is the correct count.

Connected Clients

Is this the wrong way to get the count of all connected clients? I also tried to count the connects and disconnects manually, but after one day there were more disconnects than connects, the count was negative.

Related: #349

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions