1

I am using avahi for service advertisement and discovery. As we all know avahi needs dbus as well and hence dbus-1.6.8 library is also added. i am starting dbus-daemon and avahi-daemon at startup. both daemons are running, which i could see in process list.

But when I try to create avahi client, ::avahi_client_new call fails with error "An unexpected D-Bus error occured", which is AVAHI_ERR_DBUS_ERROR = -22, /**< An unexpected D-Bus error occured */

Bellow is my function all.

Client = ::avahi_client_new(
    ::avahi_threaded_poll_get(Poll),
    static_cast<AvahiClientFlags>(0),
    &AvahiWrapper::OnClientStateChange,
    NULL,
    &error);

PS: Poll = ::avahi_threaded_poll_new(); is successful.

Please let me if anyone has any clue on this problem. Or at-least how to debug.

Thanks in advance.

0 Answers0