MDNS service persistence
Posted: Fri Sep 03, 2021 12:30 am
I noticed that mdns record that I am publishing, disappears after some time. My code follows mdns example:
I can see the published record e.g. in avahi-browse in linux, but that record goes away after some time even though the device is still up.
Thanks.
Code: Select all
mdns_init();
mdns_hostname_set(hostname);
mdns_instance_name_set(instance_name);
const int txt_length = 1;
mdns_txt_item_t txt[txt_length] = {
{"topic", "some_topic"}
};
mdns_service_add(nullptr, "_myservice", "_tcp", 20000, txt, txt_length);
Thanks.