I know the client part may use disconnect method to disconnect a client connection. but I can't find any way to disconnect from the server part.
socket.on('connection', function(client) {
client.on('message', function(message) {
var sessionId = message.disId;
socket.disconnect(sessionId);//to disconnect another client
});
});
The server can kick a particular client by using either of these methods:
client._onDisconnect();
(or)
socket.clients[kickedUserSocketId].onDisconnect();
Credit to SeanColombo on GitHub