diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-03 14:43:50 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-03 16:22:05 +0200 |
commit | b985cb3474132a802df647e0438a2872c02c71fa (patch) | |
tree | 9c12e59e819098427d0aed15083668b86caea21b | |
parent | 55582d8af3627adf09ebf6ac586753ad4f6abe59 (diff) | |
download | telepathy-glib-b985cb3474132a802df647e0438a2872c02c71fa.tar.gz |
stream tube examples: use tp_channel_close_async()
-rw-r--r-- | examples/client/stream-tubes/offerer.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/examples/client/stream-tubes/offerer.c b/examples/client/stream-tubes/offerer.c index e32cc642f..d33ba7c91 100644 --- a/examples/client/stream-tubes/offerer.c +++ b/examples/client/stream-tubes/offerer.c @@ -3,11 +3,20 @@ static GMainLoop *loop = NULL; static void -channel_closed_cb (TpChannel *channel, - const GError *error, - gpointer user_data, - GObject *weak_object) +channel_closed_cb (GObject *object, + GAsyncResult *result, + gpointer user_data) { + TpChannel *channel = TP_CHANNEL (object); + GError *error = NULL; + + if (!tp_channel_close_finish (channel, result, &error)) + { + g_debug ("Failed to close tube channel: %s", error->message); + g_error_free (error); + return; + } + g_debug ("Tube channel closed"); } @@ -53,8 +62,7 @@ _incoming_iostream (TpStreamTubeChannel *tube, g_output_stream_write (out, "Pong", 4, NULL, &error); g_assert_no_error (error); - tp_cli_channel_call_close (TP_CHANNEL (tube), -1, channel_closed_cb, - NULL, NULL, NULL); + tp_channel_close_async (TP_CHANNEL (tube), channel_closed_cb, NULL); g_object_unref (tube); } |