You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can io.sockets.emit('foo', 'bar') to send a send a message to everyone from outside of an individual socket. But what if you want to send a message to everyone in one room only from outside of an individual socket? Something like io.sockets.to('room').emit('foot', 'bar')
Use-case would be polling a database for updates and sending them to everyone in one room only. You don't want every single client in that room doing their own database poll.
The text was updated successfully, but these errors were encountered:
You can
io.sockets.emit('foo', 'bar')
to send a send a message to everyone from outside of an individual socket. But what if you want to send a message to everyone in one room only from outside of an individual socket? Something likeio.sockets.to('room').emit('foot', 'bar')
Use-case would be polling a database for updates and sending them to everyone in one room only. You don't want every single client in that room doing their own database poll.
The text was updated successfully, but these errors were encountered: