mjansson / mdns

Public domain mDNS/DNS-SD library in C
The Unlicense
436 stars 117 forks source link

Howto listen to changes after first query. #68

Open stefbon opened 1 year ago

stefbon commented 1 year ago

Hi,

implementing this library in my own project, I very much want to know howto listen to changes like a host (with dns services) is showing upp or removed for example. A socket/fd for every interface has to be listning to this (and watched by an eventloop). And then?

Stef

stefbon commented 1 year ago

Can I use the mdns_announce_multicast to let other mdns hosts know my software is interested in announces/goodbyes (==changes in services and/or hosts going down)?

stefbon commented 10 months ago

I've found the following: MDNS responders should send an unsolicited Multicast response packet, with the exact same values it would send after a query for services, but then with TTL zero. This enables listning and receiving neighbours to delete the entry from their cache. (see: rfc6762). Also - when a host is not configured properly, is crashing or is not working according the specs, I think it would be smart to

Maybe add this in the example software.