这是我的列表 (已更新为1.0) :
// sending to sender-client onlysocket.emit('message', "this is a test");// sending to all clients, include senderio.emit('message', "this is a test");// sending to all clients except sendersocket.broadcast.emit('message', "this is a test");// sending to all clients in 'game' room(channel) except sendersocket.broadcast.to('game').emit('message', 'nice game');// sending to all clients in 'game' room(channel), include senderio.in('game').emit('message', 'cool game');// sending to sender client, only if they are in 'game' room(channel)socket.to('game').emit('message', 'enjoy the game');// sending to all clients in namespace 'myNamespace', include senderio.of('myNamespace').emit('message', 'gg');// sending to individual socketidsocket.broadcast.to(socketid).emit('message', 'for your eyes only');// list socketidfor (var socketid in io.sockets.sockets) {} ORObject.keys(io.sockets.sockets).forEach((socketid) => {});


