### Function

# Gio DBusConnection new_for_address

since: 2.26

#### Declaration [src]

    void
    g_dbus_connection_new_for_address (
      const gchar* address,
      GDBusConnectionFlags flags,
      GDBusAuthObserver* observer,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

Asynchronously connects and sets up a D-Bus client connection for exchanging D-Bus messages with an endpoint specified by `address` which must be in the D-Bus address format.

This constructor can only be used to initiate client-side connections - use `g_dbus_connection_new()` if you need to act as the server. In particular, `flags` cannot contain the `G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER`, `G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS` or `G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER` flags.

When the operation is finished, `callback` will be invoked. You can then call `g_dbus_connection_new_for_address_finish()` to get the result of the operation.

If `observer` is not `NULL` it may be used to control the authentication process.

This is an asynchronous failable constructor. See `g_dbus_connection_new_for_address_sync()` for the synchronous version.

Available since: 2.26

This function completes asynchronously. Use `g_dbus_connection_new_for_address_finish()` inside the `GAsyncReadyCallback` to obtain the result of the operation.

#### Parameters

`address`

  Type: `const gchar*`

  A D-Bus address.

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

`flags`

  Type: `GDBusConnectionFlags`

  Flags describing how to make the connection.

`observer`

  Type: `GDBusAuthObserver`

  A `GDBusAuthObserver` or `NULL`.

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

`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` to call when the request is satisfied.

`user_data`

  Type: `gpointer`

  The data to pass to `callback`.

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