Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.sockets.to('room').emit() needed #293

Closed
jakeg opened this issue Jun 26, 2011 · 3 comments
Closed

io.sockets.to('room').emit() needed #293

jakeg opened this issue Jun 26, 2011 · 3 comments

Comments

@jakeg
Copy link

jakeg commented Jun 26, 2011

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.

@rauchg
Copy link
Contributor

rauchg commented Jun 26, 2011

io.sockets.in('room').emit('foot', 'bar')

@rauchg rauchg closed this as completed Jun 26, 2011
@jakeg
Copy link
Author

jakeg commented Jun 26, 2011

sweet

1 similar comment
@FrancisLeon
Copy link

sweet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants