[avahi] Do I need to do the avahi_service_resolver_free
arhold at gmail.com
Thu Nov 29 23:21:22 PST 2007
I'm building a service publish/browser application based on avahi.
For the publish app, it publishes a new service and then update the service
every 10 second with avahi_entry_group_update_service_txt (in order to keep
alive). In the browser side, a ResolverCallback is set for this particular
service. When there's a service update, the ResolverCallback receive an
AVAHI_RESOLVER_FOUND event and the updated service will be handled.
When I did the testing, I tried to ifdown the netif in the "publish" side,
but keep the publish application running. Then, in the "browser" side, after
a while, an AVAHI_RESOLVER_FAILURE event will be received in
ResolverCallback. In my code, avahi_service_resolver_free will be called at
this moment to free the resolver. Then, I did an ifup in the "publish" to
resume the netif, which was downed previously. The service broadcast was
resumed. However, in the "browser" side, because the resolver is already
gone and no new event can be caught. The browser will never be able to get
the service anymore.
My questions is:
In this scenario - service unreachable and then recovered, which is the
right way to handle in browser side? Is it necessary to call
avahi_service_resolver_free when AVAHI_RESOLVER_FAILURE? I try to remove
that code and when the netif was recovered, the browser will be able t o get
the service again.
Appreciate your help, thank in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the avahi