socket io client emit js code example
Example 1: socket emit to
io.to(socketid).emit('message', 'whatever');
Example 2: io.emit vs socket.emit
socket.emit('message', "this is a test"); //sending to sender-client only
io.emit('message', "this is a test"); //sending to all clients, include sender