[avahi] Race condition using the avahi D-Bus interface?

Danny Smit danny.smit.0 at gmail.com
Tue Dec 23 07:22:29 PST 2014


Hi everyone,

I'm running into a problem with avahi which looks similar to the
following reported issue: http://avahi.org/ticket/247

However in this case I'm using c++ / Qt to connect to the avahi
daemon. This basically exists out of two steps:

1. Create a ServiceBrowser using the D-Bus API ServiceBrowserNew
2. Connect to the ItemNew signal of the created ServiceBrowser

It seems that at step 1 the browser immediately start resolving
services and that it may occur that the ItemNew signal is emitted even
before step 2 is finished. The way the avahi ServiceBrowser is
designed, there is no way to influence this. From my point of view it
looks like this design is prone to race conditions.

My question is, how is this supposed to work? Should I use the avahi
interface differently? Or is this a bug in the design of the avahi
ServiceBrowser D-Bus interface?

Any help would be greatly appreciated.

Kind regards,

Danny


More information about the avahi mailing list