Skip to content

Feature: disconnect all sockets of a room. #3570

@royalpinto

Description

@royalpinto

Feature request:

I would like to request a feature to disconnect all sockets of a given room.

Use case:

A logged-in user has multiple connections to the server (and are also connected to different node processes). Upon user logout or session expiry, I would like to disconnect all the client connections of that user session. So, I have created a unique room for each user session id and joined all the connections to that room. So I can simply disconnect all the clients connected to that room (i.e to that session).

Expecting something like this:

io.in('room-name').disconnect(true)

This is missing as of now in the lib. Also, it should send signals over the adaptor to other processes to disconnect from all the other processes too.

Any suggestions? If it's a good approach, I can create a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions