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

Add clientAddress to emited 'accept' event #48

Merged
merged 6 commits into from
May 24, 2014

Conversation

jonathanwiesel
Copy link
Contributor

This way you can use the following function:

bleno.on('accept', function(clientAddress){
   console.log('Client address is' + clientAddress);
});

I specifically find it useful for "session" validation.

If merged, npm publishing would be awesome 😃.

Keep up the good work.

@jonathanwiesel
Copy link
Contributor Author

This also refs #36

@jonathanwiesel
Copy link
Contributor Author

BTW, is there a way to know the client's address inside the onReadRequest / onWriteRequest to know which client is making the request in case many are connected?

@sandeepmistry
Copy link
Collaborator

@jonathanwiesel looks good! Could you also please update the read me. What to you think about adding the address to the disconnect event as well?

Currently only one client can be connected at a time.

@jonathanwiesel
Copy link
Contributor Author

@sandeepmistry done, hope it help others as well 😉

sandeepmistry added a commit that referenced this pull request May 24, 2014
Add clientAddress to emited 'accept' event
@sandeepmistry sandeepmistry merged commit d29018c into noble:master May 24, 2014
@sandeepmistry
Copy link
Collaborator

Thanks @jonathanwiesel, I've published v0.1.5 to npm as well.

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.

2 participants