diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/client-browse-services.c | 4 | ||||
-rw-r--r-- | examples/client-publish-service.c | 7 | ||||
-rw-r--r-- | examples/glib-integration.c | 4 |
3 files changed, 4 insertions, 11 deletions
diff --git a/examples/client-browse-services.c b/examples/client-browse-services.c index c5a1cbd..00703e6 100644 --- a/examples/client-browse-services.c +++ b/examples/client-browse-services.c @@ -145,8 +145,8 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN /* Called whenever the client or server state changes */ - if (state == AVAHI_CLIENT_DISCONNECTED) { - fprintf(stderr, "Server connection terminated.\n"); + if (state == AVAHI_CLIENT_FAILURE) { + fprintf(stderr, "Server connection failre: %s\n", avahi_strerror(avahi_client_errno(c))); avahi_simple_poll_quit(simple_poll); } } diff --git a/examples/client-publish-service.c b/examples/client-publish-service.c index 2f126c1..50a7002 100644 --- a/examples/client-publish-service.c +++ b/examples/client-publish-service.c @@ -150,13 +150,6 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN avahi_entry_group_reset(group); break; - case AVAHI_CLIENT_DISCONNECTED: - - fprintf(stderr, "Server connection terminated.\n"); - avahi_simple_poll_quit(simple_poll); - - break; - case AVAHI_CLIENT_FAILURE: fprintf(stderr, "Client failure: %s\n", avahi_strerror(avahi_client_errno(c))); diff --git a/examples/glib-integration.c b/examples/glib-integration.c index bf6eacf..f1830d8 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); |