开发者

avahi: broadcast that my service has updated information

开发者 https://www.devze.com 2023-02-27 11:00 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号