X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fglib-integration.c;h=ab53687693f173d8213f7a3e2c3d97f98aae2f72;hb=93293a573bda5eae15813b4c771863f740a01dd1;hp=bf6eacf6139ca77da04548f79135d7d00205eb86;hpb=854f901f491ccda79aee11edc3d59109cb229d28;p=catta diff --git a/examples/glib-integration.c b/examples/glib-integration.c index bf6eacf..ab53687 100644 --- a/examples/glib-integration.c +++ b/examples/glib-integration.c @@ -60,10 +60,10 @@ avahi_client_callback (AVAHI_GCC_UNUSED AvahiClient *client, AvahiClientState st g_message ("Avahi Client State Change: %d", state); - if (state == AVAHI_CLIENT_DISCONNECTED) + if (state == AVAHI_CLIENT_FAILURE) { /* We we're disconnected from the Daemon */ - g_message ("Disconnected from the Avahi Daemon"); + g_message ("Disconnected from the Avahi Daemon: %s", avahi_strerror(avahi_client_errno(client))); /* Quit the application */ g_main_loop_quit (loop); @@ -108,6 +108,7 @@ main (AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) /* Create a new AvahiClient instance */ client = avahi_client_new (poll_api, /* AvahiPoll object from above */ + 0, avahi_client_callback, /* Callback function for Client state changes */ loop, /* User data */ &error); /* Error return */