最終更新:2020-08-06 (木) 09:24:21 (1321d)
Socket.IO/送信
io.emit/io.sockets.emit emit an event to all connected sockets 全クライアント socket.emit emit an event to the socket クライアント(自身) socket.broadcast.emit sending a message to everyone else except for the socket that starts it. 自分以外 socket.to(room).emit except sender ルーム(自身除く) socket.to(room1).to(room2).emit except sender ルーム(自身除く) io.in(room).emit in room, including sender ルーム (自身含む) io.of(namespace).emit including sender 名前空間(自身含む) io.of(namespace).to(room).emit including sender 名前空間、ルーム(自身含む) io.to?(id).emit send to id id
- socket.to(socket.id).emit()` will NOT work