[gnio/connection-factory] Use g_socket_client_connect_to_host instead of g_tcp_client_..



commit da15109b0f884083a80fc744dff82515d70a3e99
Author: Alexander Larsson <alexl redhat com>
Date:   Fri May 8 21:25:39 2009 +0200

    Use g_socket_client_connect_to_host instead of g_tcp_client_..
---
 examples/client.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/examples/client.c b/examples/client.c
index 87f83f7..e7c132c 100644
--- a/examples/client.c
+++ b/examples/client.c
@@ -2,11 +2,11 @@
 
 static void
 ready (GObject *obj,
-    GAsyncResult *result,
-    gpointer user_data)
+       GAsyncResult *result,
+       gpointer user_data)
 {
-  GTcpClient *client = G_TCP_CLIENT (obj);
-  GTcpConnection *connection;
+  GSocketClient *client = G_SOCKET_CLIENT (obj);
+  GSocketConnection *connection;
   GError *error = NULL;
   GInputStream *input;
   GOutputStream *output;
@@ -15,7 +15,7 @@ ready (GObject *obj,
   char buffer[2048];
   gssize bytes;
 
-  connection = g_tcp_client_connect_finish (client, result, &error);
+  connection = g_socket_client_connect_finish (client, result, &error);
 
   if (connection == NULL)
     g_error ("connect: %s: %d, %s", g_quark_to_string (error->domain), error->code, error->message);
@@ -57,16 +57,16 @@ main (void)
 {
   GError *error = NULL;
   GTcpConnection *connection;
-  GTcpClient *client;
+  GSocketClient *client;
   GInputStream *input;
   char buffer[2048];
   gssize bytes;
 
   g_type_init ();
 
-  client = g_tcp_client_new ();
-  g_tcp_client_connect_to_host_async (client, "mail.desrt.ca",
-                                      143, NULL, ready, NULL);
+  client = g_socket_client_new ();
+  g_socket_client_connect_to_host_async (client, "mail.desrt.ca",
+					 143, NULL, ready, NULL);
 
   g_main_loop_run (g_main_loop_new (NULL, FALSE));
   g_error ("hi?");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]