Socketio.leave()

Unsubscribes the specified sockets from a room.

Unsubscribes the sockets from the room with the specified name. Any messages subsequently broadcast to the room will no longer be received by those sockets.

Usage

Hover over inputs/exits for more info.

var Socketio = require('machinepack-sockets');


// Unsubscribes the specified sockets from a room.

Socketio.leave({

roomName: 'myChatRoom',

socketIds: [ 'a82ghda99319gadgaa3249103' ],

}).execSync();

Inputs

roomName required

The name of the room to leave.

'myChatRoom'
socketIds required

Unique identifiers of the sockets to subscribe to the room.

[ 'a82ghda99319gadgaa3249103' ]

Exits

error

An unexpected error occurred.

success

OK.