Sets a modifier for a subsequent event emission that the event will only be broadcasterd to sockets that have joined the given room.
To emit to multiple rooms, you can call to several times.
var io = require('socket.io')();
io.on('connection', function(socket) {
socket.to('others').emit('an event', { some: 'data'});
});
Sets a modifier for a subsequent event emission that the event will only be
broadcasterdto sockets that have joined the givenroom.To emit to multiple rooms, you can call
toseveral times.