最終更新:2020-08-06 (木) 09:24:21 (1368d)  

Socket.IO/送信
Top / Socket.IO / 送信

  • io.emit/io.sockets.emitemit an event to all connected sockets全クライアント
    socket.emitemit an event to the socketクライアント(自身)
    socket.broadcast.emitsending a message to everyone else except for the socket that starts it.自分以外
    socket.to(room).emitexcept senderルーム(自身除く)
    socket.to(room1).to(room2).emitexcept senderルーム(自身除く)
    io.in(room).emitin room, including senderルーム (自身含む)
    io.of(namespace).emitincluding sender名前空間(自身含む)
    io.of(namespace).to(room).emitincluding sender名前空間、ルーム(自身含む)
    io.to?(id).emitsend to idid
  • socket.to(socket.id).emit()` will NOT work

チートシート

関連