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

Cant see all the services published via polo #19

Open
sonyarouje opened this issue Nov 20, 2014 · 5 comments
Open

Cant see all the services published via polo #19

sonyarouje opened this issue Nov 20, 2014 · 5 comments

Comments

@sonyarouje
Copy link

Hi,
I am not sure whether my scenario will work with polo. This is my scenario.

I have two node js app running in two Raspberry pi, each has different IP address and different name. Both are published using apps.put(...);

I wrote another nodejs app running in my windows laptop that just listen and log all the polo services as shown below. (I ran it in a Raspberry pi as well and the result is same.)

apps.once('up', function(name, service) {
console.log(apps.get(name));
});

Issue:
I was expecting the 'up' event will display both the service when ever it starts running. But here I could only see the first service published to polo. It's not at all showing the second service.

Node js version: 0.10.26

Can any one please tell whether Polo's 'up' event can continuously listen for the services, or it will show only the service published in the app that started first?

Regards,
Sony Arouje

@sonyarouje sonyarouje changed the title Cant see all the device published via polo Cant see all the services published via polo Nov 20, 2014
@willemmulder
Copy link
Collaborator

Could be because of wifi router issues with UDP Multicast. There's apparently many issues there. Using broadcast instead of multicast might fix it.

I don't want to promote my own autodiscovery library here, but if you could test with Diont (https://github.com/willemmulder/Diont) and use the broadcast:true flag to see whether that fixes it, we know what the problem is, and might add broadcast functionality to Polo as well.

@mafintosh
Copy link
Owner

@willemmulder awesome! i just made you co-owner of polo in case you want work on some of those features (if not its cool too :))

@willemmulder
Copy link
Collaborator

Thanks, I'll see what I can do! :-)

@siboulet
Copy link
Contributor

@sonyarouje I think your problem is you're using apps.once, which only trigger once. You probably want to use apps.on. Maybe the example on README should be updated to use on() instead of once().

apps.on('up', function(name, service) {
console.log(apps.get(name));
});

@sonyarouje
Copy link
Author

Thanks @siboulet thanks for your response. I will give a try, right now I solved it using node-discovery module.

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

4 participants