### Method

# Gio SocketConnection connect_async

since: 2.32

#### Declaration

    void
    g_socket_connection_connect_async (
      GSocketConnection* connection,
      GSocketAddress* address,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description

Asynchronously connect `connection` to the specified remote address.

This clears the `GSocket:blocking` flag on `connection`‘s underlying socket if it is currently set.

If `GSocket:timeout` is set, the operation will time out and return `G_IO_ERROR_TIMED_OUT` after that period. Otherwise, it will continue indefinitely until operating system timeouts (if any) are hit.

Use `g_socket_connection_connect_finish()` to retrieve the result.

Available since: 2.32

#### Parameters

`address`

  Type: `GSocketAddress`

  A `GSocketAddress` specifying the remote address.

  The data is owned by the caller of the method.

`cancellable`

  Type: `GCancellable`

  A %GCancellable or `NULL`.

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

`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 method.