becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

Service Announcements delayed on Android #34

Closed manavkumarm closed 7 years ago

manavkumarm commented 7 years ago

The zeroconf.watch method takes up to 30 seconds-1 minute to receive a service announcement on Android, whereas the announcement is almost instant on iOS. Any idea what might account for the difference in user experience and how it might be resolved?

becvert commented 7 years ago

no idea. feel free to review the code. have a look at the underlying libraries too

knro commented 7 years ago

I am confused by the "watch" part. Does this work for only NEW services registered after watch is called? or it lists all existing services on the network?

EDIT: Ok, so it appears it immediately lists them. But it's not working for me. I'll create an issue for that.

becvert commented 7 years ago

Please upgrade to 1.2.5 and try

var zeroconf = cordova.plugins.zeroconf;
zeroconf.watchAddressFamily = 'ipv4'; // or 'ipv6' ('any' by default)
julianCast commented 7 years ago

On version 1.2.6 and adding the ipv4 options. It still takes about 8 seconds to receive the first service, the rest are inmediate. It looks like is the bonjour connection.