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 | 55582d8af3627adf09ebf6ac586753ad4f6abe59 (patch) | |
tree | 7bcef683db7801acd5e3bc6d299e1118b729354e /examples/client | |
parent | c93cd8f2bbb9c8888ba3a4ad153a485e33568a4c (diff) | |
download | telepathy-glib-55582d8af3627adf09ebf6ac586753ad4f6abe59.tar.gz |
stream tube examples: split sending/receiving data debug messages
Make it easier to understand/debug what's going on.
Diffstat (limited to 'examples/client')
-rw-r--r-- | examples/client/stream-tubes/accepter.c | 3 | ||||
-rw-r--r-- | 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); |