mdns icon indicating copy to clipboard operation
mdns copied to clipboard

Why avahi-browse shows more answers?

Open Darkcacok opened this issue 6 years ago • 4 comments

When I use avahi-browse --all I get more services than using your library. I send a request and wait for a response and this repeats in a loop. I use both ipv4 and ipv6

Darkcacok avatar Mar 26 '20 10:03 Darkcacok

I assume avahi-browse uses the avahi service, so it might have caught earlier broadcasts and responses which were not sent in reply to the DNS-SD question sent by this library when you run your tests?

You could set breakpoints in mdns_discovery_recv on the early outs (lines with return 0) and see if some answer records are being discarded, and why.

mjansson avatar Mar 26 '20 15:03 mjansson

I use the program Wireshark, and I get the impression that avahi-browse is reading what comes at 224.0.0.251.

Darkcacok avatar Mar 26 '20 16:03 Darkcacok

That's the multicast IPv4 address, yes. However, responses to DNS-SD queries should be sent unicast. This library does not (yet) listen to multicast announces.

mjansson avatar Mar 29 '20 20:03 mjansson

Clarification, the library listens to multicast queries when in listening mode (acting as a server), but not to multicast annouces for service discovery (acting as a client)

mjansson avatar Mar 29 '20 20:03 mjansson