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

Make list of clients in a room accessible #13

Merged
merged 3 commits into from Apr 5, 2014
Merged

Make list of clients in a room accessible #13

merged 3 commits into from Apr 5, 2014

Conversation

fodor0205
Copy link
Contributor

I found it extremely useful to get the list of clients for a session / room.

This way I can access each socket with a forEach loop:

socketClients().forEach(function (s) {
    s.join('room');
});

@fodor0205
Copy link
Contributor Author

I use send() to respond to the current socket with the callback.

Server side:

action(function join () {
    send({ foo: 'bar' });
});

On the client side:

socket.emit('join', {}, function (data) {
    console.log(data.foo); // bar
});

Sorry for combined pull request

@1602
Copy link
Member

1602 commented Apr 3, 2014

Awesome. Could you please add some information about this feature to README.md file. Thanks!

Add little pieces of information (like filenames) to usage
@fodor0205
Copy link
Contributor Author

I've added the informations to the readme, please check it. @1602

@1602
Copy link
Member

1602 commented Apr 5, 2014

Thank you very much!

1602 added a commit that referenced this pull request Apr 5, 2014
Make list of clients in a room accessible
@1602 1602 merged commit f7b3161 into compoundjs:master Apr 5, 2014
@fodor0205
Copy link
Contributor Author

@1602 can you publish the changes to npm?

@1602
Copy link
Member

1602 commented Apr 9, 2014

Published as co-socket@0.0.2

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

Successfully merging this pull request may close these issues.

None yet

2 participants