summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGian Mario Tagliaretti <gianmt@gnome.org>2009-12-31 10:10:43 +0100
committerGian Mario Tagliaretti <gianmt@gnome.org>2009-12-31 10:10:43 +0100
commit116ea1bfe32946e67aa54eb8dc7b977e57f254c2 (patch)
treed5c38c44fc7518236aff00d6132b1fb89bf702f7
parent9c930910505d5b9001b8cec17ff98fadeaa799e2 (diff)
downloadpygobject-116ea1bfe32946e67aa54eb8dc7b977e57f254c2.tar.gz
pygobject-116ea1bfe32946e67aa54eb8dc7b977e57f254c2.tar.xz
pygobject-116ea1bfe32946e67aa54eb8dc7b977e57f254c2.zip
Wrap gio.SocketClient.connect_to_host_async()
-rw-r--r--gio/gsocket.override48
1 files changed, 48 insertions, 0 deletions
diff --git a/gio/gsocket.override b/gio/gsocket.override
index c44af34..bfe7df2 100644
--- a/gio/gsocket.override
+++ b/gio/gsocket.override
@@ -153,6 +153,54 @@ _wrap_g_socket_client_connect_async(PyGObject *self,
pygio_notify_free(notify);
return NULL;
}
+%%
+override g_socket_client_connect_to_host_async kwargs
+static PyObject *
+_wrap_g_socket_client_connect_to_host_async(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "callback", "host_and_port", "default_port",
+ "cancellable", "user_data", NULL };
+ PyGIONotify *notify;
+ PyGObject *py_cancellable = NULL;
+ GCancellable *cancellable;
+ gchar *host_and_port;
+ guint16 default_port;
+
+ notify = pygio_notify_new();
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "OsH|OO:gio.SocketClient.connect_to_host_async",
+ kwlist,
+ &notify->callback,
+ &host_and_port,
+ &default_port,
+ &py_cancellable,
+ &notify->data))
+ goto error;
+
+ if (!pygio_notify_callback_is_valid(notify))
+ goto error;
+
+ if (!pygio_check_cancellable(py_cancellable, &cancellable))
+ goto error;
+
+ pygio_notify_reference_callback(notify);
+
+ g_socket_client_connect_to_host_async(G_SOCKET_CLIENT(self->obj),
+ host_and_port, default_port,
+ cancellable,
+ (GAsyncReadyCallback) async_result_callback_marshal,
+ notify);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+ error:
+ pygio_notify_free(notify);
+ return NULL;
+}
/* Could not write method GSocket.receive_from: No ArgType for GSocketAddress** */
/* Could not write method GSocket.receive_message: No ArgType for GSocketAddress** */