No. Best roll your own implementation here. The easiest choice is to use io.sockets.clients()
to get a list of all sockets, then exclude the originating socket.
Created
October 23, 2011 07:34
-
-
Save tcr/1307000 to your computer and use it in GitHub Desktop.
Using node.js and socket.io, when I broadcast to all other sockets with a callback, can I get a reference to each socket inside the callback?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Iterate through all sockets excluding origin | |
broadcast = (origin, fn) -> | |
fn(socket) for socket in io.sockets.clients() when socket != origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment