当我广播邮件发件人客户端时,也会收到来自NodeJs的通知,这里是我的代码,任何发送获取通知的机会
socket.on('Room', function(data) {
console.log(' Room : '+data);
socket.broadcast.emit('Room', {'Room': 'Room'});
});
答案 0 :(得分:1)
Send response to all clients except sender (Socket.io)
// sending to all clients in 'game' room(channel) except sender
socket.broadcast.to('game').emit('message', 'nice game');