【发布时间】:2019-11-23 07:28:02
【问题描述】:
尝试为整个套接字连接和所有连接到套接字的客户端发出事件。 用过,
io.sockets.emit('toALL',{msg: 'this is demo'});
并在index.html 中使用以下代码行处理它:
socket.on("toALL",function(){
// If console is putted here still not able to get any msg or response from emit.
});
【问题讨论】:
标签: node.js sockets events socket.io emit