[telepathy-doc/master] Update gnio-receiver with the same patch

Davyd Madeley davyd at madeley.id.au
Thu Apr 9 08:05:47 PDT 2009


---
 docs/examples/glib_salut_ft/gnio-receiver.c |   27 +++++++--------------------
 1 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/docs/examples/glib_salut_ft/gnio-receiver.c b/docs/examples/glib_salut_ft/gnio-receiver.c
index fc9d078..174d3b0 100644
--- a/docs/examples/glib_salut_ft/gnio-receiver.c
+++ b/docs/examples/glib_salut_ft/gnio-receiver.c
@@ -70,11 +70,10 @@ accept_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);
 	}
 }
 
@@ -104,22 +103,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