Method

GioSocketClientconnect_to_host_async

since: 2.22

Declaration

void
g_socket_client_connect_to_host_async (
  GSocketClient* client,
  const gchar* host_and_port,
  guint16 default_port,
  GCancellable* cancellable,
  GAsyncReadyCallback callback,
  gpointer user_data
)

Description

This is the asynchronous version of g_socket_client_connect_to_host().

When the operation is finished callback will be called. You can then call g_socket_client_connect_to_host_finish() to get the result of the operation.

Available since: 2.22

Parameters

host_and_port

Type: const gchar*

The name and optionally the port of the host to connect to.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
default_port

Type: guint16

The default port to connect to.

cancellable

Type: GCancellable

A GCancellable, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
callback

Type: GAsyncReadyCallback

A GAsyncReadyCallback.

The argument can be NULL.
user_data

Type: gpointer

User data for the callback.

The argument can be NULL.
The data is owned by the caller of the function.