avahi: broadcast that my service has updated information
I have an avahi (zeroconf, dnssd, bonjour) service. I want the service to be able to notify the clients when it has new data so the clients can then connect and query for the updated information.
What type of message开发者_JAVA技巧 should the service publish, and how is this done with the avahi API (service is written in C++)?
I don't know what C++ API you are refering to, but this is how you do it in the C-layer. You can use the following functions in avahi to update the TXT record of the service.
avahi_entry_group_update_service_txt (AvahiEntryGroup *g, ...)
avahi_entry_group_update_service_txt_strlst (AvahiEntryGroup *g, ...)
Listening clients will receive a service updated event.
精彩评论