### Function

# Dex bus_own_name_on_connection

since: 1.1

#### Declaration [src]

    void
    dex_bus_own_name_on_connection (
      GDBusConnection* connection,
      const char* name,
      GBusNameOwnerFlags flags,
      DexFuture** out_name_acquired_future,
      DexFuture** out_name_lost_future
    )

#### Description [src]

Wrapper for `g_bus_own_name()`.

Asks the D-Bus broker to own the well-known name `name` on the connection `connection`.

`out_name_acquired_future` is a future that awaits owning the name and either resolves to true, or rejects with an error.

`out_name_lost_future` is a future that rejects when the name was lost.

If either future is canceled, the name will be unowned.

Available since: 1.1

#### Parameters

`connection`

  Type: `GDBusConnection`

  The `GDBusConnection` to own a name on.

  The data is owned by the caller of the function.

`name`

  Type: `const char*`

  The well-known name to own.

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

`flags`

  Type: `GBusNameOwnerFlags`

  A set of flags with ownership options.

`out_name_acquired_future`

  Type: `DexFuture`

  A location for the name acquired future.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.

`out_name_lost_future`

  Type: `DexFuture`

  A location for the name lost future.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.