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

Tweak to migration guide on http://socket.io website #1908

Closed
mikermcneil opened this issue Dec 12, 2014 · 3 comments
Closed

Tweak to migration guide on http://socket.io website #1908

mikermcneil opened this issue Dec 12, 2014 · 3 comments

Comments

@mikermcneil
Copy link

Hey y'all- I was poking around for where to send a PR, but looks like the website has database-hosted content. Anyways minor thing, but I wanted to be sure and leave a note about it while it was fresh on my mind:

On http://socket.io/docs/migrating-from-0-9/, we're not currently mentioning anything about the io.sockets.clients() method being deprecated.

e.g.

/Users/mikermcneil/code/sails/lib/hooks/pubsub/index.js:296
        return sails.io.sockets.clients(roomName);
                                ^
TypeError: Object #<Namespace> has no method 'clients'
  at Object.sails.sockets.subscribers (/Users/mikermcneil/code/sails/lib/hooks/pubsub/index.js:296:33)

When I get a solution sorted out momentarily, I'll post it here for anyone else who might find this issue on the googles.

@mikermcneil
Copy link
Author

good ole stack overflow. I don't even know why I bother typing anymore

Get all connected sockets belonging to a room:

http://stackoverflow.com/a/24811267/486547

Get all connected sockets belonging to an entire namespace:

http://stackoverflow.com/a/27383947/486547

@barisusakli
Copy link

Keep in mind those solutions will not work in a multi node environment, there is ongoing discussion in this PR #1630 about bringing .clients() back

@mikermcneil
Copy link
Author

@barisusakli thanks for the heads up, makes sense. (closing this)

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
@mikermcneil @barisusakli and others