[telepathy-doc/master] Update gnio-sender per ryanl's feedback
Davyd Madeley
davyd at madeley.id.au
Thu Apr 9 07:52:31 PDT 2009
---
docs/examples/glib_salut_ft/gnio-sender.c | 27 +++++++--------------------
1 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/docs/examples/glib_salut_ft/gnio-sender.c b/docs/examples/glib_salut_ft/gnio-sender.c
index a191a80..5d98bf0 100644
--- a/docs/examples/glib_salut_ft/gnio-sender.c
+++ b/docs/examples/glib_salut_ft/gnio-sender.c
@@ -70,11 +70,10 @@ provide_file_cb (TpChannel *channel,
g_value_array_get_nth (address, 1));
g_print (" > file_transfer_cb (tcp:%s:%i)\n", host, port);
- /* RYAN!
+ GInetAddress *addr = g_inet_address_new_from_string (host);
ftstate->address = G_SOCKET_ADDRESS (
- g_tcp_client_get_connectable (host, port, &error));
- handle_error (error);
- */
+ g_inet_socket_address_new (addr, port));
+ g_object_unref (addr);
}
}
@@ -107,22 +106,10 @@ file_transfer_state_changed_cb (TpChannel *channel,
if (state == TP_FILE_TRANSFER_STATE_OPEN)
{
- if (G_IS_UNIX_CLIENT (ftstate->client))
- {
- ftstate->connection = G_SOCKET_CONNECTION (
- g_unix_client_connect (
- G_UNIX_CLIENT (ftstate->client),
- G_SOCKET_CONNECTABLE (ftstate->address),
- NULL, &error));
- }
- else if (G_IS_TCP_CLIENT (ftstate->client))
- {
- ftstate->connection = G_SOCKET_CONNECTION (
- g_tcp_client_connect (
- G_TCP_CLIENT (ftstate->client),
- G_SOCKET_CONNECTABLE (ftstate->address),
- NULL, &error));
- }
+ ftstate->connection = g_socket_client_connect (
+ ftstate->client,
+ G_SOCKET_CONNECTABLE (ftstate->address),
+ NULL, &error);
handle_error (error);
/* we can now use the stream like any other GIO stream.
--
1.5.6.5
More information about the telepathy-commits
mailing list