Ennova-IT / ZeRXconf

This library is our implementation of ZeroConf for Android, using native Android API and JmDNS
36 stars 11 forks source link

remove service not working #2

Open proximous opened 8 years ago

proximous commented 8 years ago

Testing with the sample app, I start discovery on _http._tcp., I then start the advertise, switch back to the discovery screen and see ZeRXconf. All is good.

I stop the advertise, switch back to the discovery, and ZeRXconf is still there. I wait and wait but it is never removed.

I use the Bonjour Browser and see the ZeRXconf immediately disappears when I stop the advertise.

Is this the expected behavior of the app?

tiwiz commented 8 years ago

Hello, Thanks for the feedback! Actually, I think it's just a bug within the sample app.

proximous commented 8 years ago

Ok. I ran the debugger and I see the problem but I'm not sure about the best solution.

ServicesAdapter:Line 48: if (services.get(i).equals(service))

This is never true. Inspecting services.get(i) and comparing to service, it's easy to see differences in the objects. serviceName and serviceLayer are the same, but the other elements in the comparison are not the same (address/port). It seems that the 'removed' NetworkServiceDiscoveryInfo object always has a null address and a servicePort of 0. Therefore they will never equal. Is that expected?