Updating to JmDNS 3.x broke our test case where the server is advertised on the loopback address. This patch makes that work again.
Are you sure we should include the loopback in the default behavior? The loopback is useful during tests but can create a bit of noise in normal use. Why not implement a TestNetworkDiscovery as documented and use it for the tests? This was supposed to be very simple the default looks a bit scary because of Android API being a bit old.
Even in production we have users who set their server to listen on 127.0.0.1, so whatever happens, it has to work over there too. The test in question is just to catch the library breaking functionality.
I guess it could be an optional setting though.
I was trying to get some of the JmmDNS unit test working and if I add the loopback it goes berserk. This may be unrelated and due to the network I am on at the moment. Could you try the unit test are commented out in the committed file but it would be nice to get them going and get better stability.
Which test in particular? (I'm doing all this from the command-line, so it isn't so easy to quickly browse through things...)
I checked the ones which are enabled and they at least pass with this change.
You're right about chattiness though, I get a lot of "fatal" log messages despite everything seeming to work correctly.
SEVERE: bad domain name: possible circular name detected. Bad offset: 0x3fff at 0x7d
WARNING: Could not find record class for index: 65535
SEVERE: Could not find record type for index: 65535
SEVERE: Could not find record type.
I seem to get most of these on the IPv6 version of the loopback address. Maybe the IPv4 one is totally quiet... sort of hard to tell.
Interestingly if you only exclude addresses where it's an instance of Inet6Address, the warnings go away but things still work in our tests, because the IPv4 loopback stuff appears to work fine.
IPv6 loopback might be the only problem?
Thanks, I have found one bug that now open another one. The hostname increment function was busted and was adding "-1" at each increment instead of incrementing this lead to a name length overflow. This is fixed.
However I have another issue as now the IPv6 looback does not recognize its own packet and try to resolve a non existent conflict.
Ok I have integrated it and fixed a few other bugs, This should be much better I still have an issue with unregistering services in JmmDNS.