Service to handle self-disconnection and banning of a user from a room.
DisconnectUserSelf
This service manages the disconnection of a user from a specified room and initiates a ban on the user.
disconnectUserSelf
The options required to disconnect the user.
The identifier of the member to be disconnected.
The name of the room from which the user will be disconnected.
The socket instance used to emit the disconnection and ban request.
The local socket instance used to emit the disconnection request.
A promise that resolves when the disconnection request is sent to the server.
const disconnectUserSelfOptions = { member: 'user123', roomName: 'room456', socket: mySocketInstance localSocket: myLocalSocketInstance};await disconnectUserSelfService.disconnectUserSelf(disconnectUserSelfOptions); Copy
const disconnectUserSelfOptions = { member: 'user123', roomName: 'room456', socket: mySocketInstance localSocket: myLocalSocketInstance};await disconnectUserSelfService.disconnectUserSelf(disconnectUserSelfOptions);
Disconnects the user from the specified room and bans them.
The options for disconnecting the user.
A promise that resolves when the disconnection request has been emitted.
Service to handle self-disconnection and banning of a user from a room.
Name
DisconnectUserSelf
Description
This service manages the disconnection of a user from a specified room and initiates a ban on the user.
Method
disconnectUserSelf
Async
Param: options
The options required to disconnect the user.
Param: options.member
The identifier of the member to be disconnected.
Param: options.roomName
The name of the room from which the user will be disconnected.
Param: options.socket
The socket instance used to emit the disconnection and ban request.
Param: options.localSocket
The local socket instance used to emit the disconnection request.
Returns
A promise that resolves when the disconnection request is sent to the server.
Example