Open sonyarouje opened 9 years ago
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.
@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 :))
Thanks, I'll see what I can do! :-)
@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));
});
Thanks @siboulet thanks for your response. I will give a try, right now I solved it using node-discovery module.
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