mdns
mdns copied to clipboard
Howto listen to changes after first query.
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
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)?
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
- a client to poll on a regular base for services (how often?)
- a callback to the mdns query software should be enabled when the application has indications a host is down/has become unreachable (for example when connections with this host are shutdown in a non proper way).
Maybe add this in the example software.