From 55582d8af3627adf09ebf6ac586753ad4f6abe59 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 3 Apr 2012 14:43:50 +0200 Subject: stream tube examples: split sending/receiving data debug messages Make it easier to understand/debug what's going on. --- examples/client/stream-tubes/accepter.c | 3 ++- examples/client/stream-tubes/offerer.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/client/stream-tubes/accepter.c b/examples/client/stream-tubes/accepter.c index 8f6e580eb..1d9966b1c 100644 --- a/examples/client/stream-tubes/accepter.c +++ b/examples/client/stream-tubes/accepter.c @@ -48,13 +48,14 @@ _tube_accepted (GObject *tube, out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); /* this bit is not a good example */ + g_debug ("Sending: Ping"); g_output_stream_write (out, "Ping", 4, NULL, &error); g_assert_no_error (error); g_input_stream_read (in, &buf, sizeof (buf), NULL, &error); g_assert_no_error (error); - g_debug ("Sent Ping got: %s", buf); + g_debug ("Received: %s", buf); g_object_unref (tube_conn); g_object_unref (tube); diff --git a/examples/client/stream-tubes/offerer.c b/examples/client/stream-tubes/offerer.c index 3b6535abd..e32cc642f 100644 --- a/examples/client/stream-tubes/offerer.c +++ b/examples/client/stream-tubes/offerer.c @@ -45,13 +45,13 @@ _incoming_iostream (TpStreamTubeChannel *tube, out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); /* this bit is not a good example */ - g_output_stream_write (out, "Pong", 4, NULL, &error); - g_assert_no_error (error); - g_input_stream_read (in, &buf, sizeof (buf), NULL, &error); g_assert_no_error (error); + g_debug ("Received: %s", buf); - g_debug ("Send Pong got: %s", buf); + g_debug ("Sending: Pong"); + 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); -- cgit v1.2.1