[avahi] avahi poll API, level triggered vs edge triggered

Gaspard Bucher gaspard at teti.ch
Mon Mar 5 23:38:12 PST 2012

Hi list !

I am having a very difficult time creating an AvahiPoll API that should be
used with an edge triggered event loop (zeroMQ).

I must confess that I do not understand why the Avahi API is so complicated
(compared with dns-sd which is already not trivial). Why can't we simply
connect to the daemon with a socket (once for each registration/browse) ?
We would then only need one file descriptor per operation and either block
on recv or insert the file descriptor in an event loop. This is the
abstraction that dns-sd manages to provide with DNSServiceRefSockFD.

Anyway, before I start to fork and create pipes, I suspect my API to not
work because of this edge vs level triggering. Is there a way to "empty"
the content of newly created AvahiWatch and AvahiTimeout before registering
the file descriptors inside the poll loop ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/avahi/attachments/20120306/7f28b931/attachment.htm>

More information about the avahi mailing list