own_name


Description:

[ CCode ( cname = "g_bus_own_name_with_closures" ) ]
[ Version ( since = "2.26" ) ]
public uint own_name (BusType bus_type, string name, BusNameOwnerFlags flags, owned BusAcquiredCallback? bus_acquired_closure = null, owned BusNameAcquiredCallback? name_acquired_closure = null, owned BusNameLostCallback? name_lost_closure = null)

Version of [func@Gio.

bus_own_name using closures instead of callbacks for easier binding in other languages.

Parameters:

bus_type

the type of bus to own a name on

name

the well-known name to own

flags

a set of flags with ownership options

bus_acquired_closure

closure to invoke when connected to the bus of type bus_type, or `NULL` to ignore

name_acquired_closure

closure to invoke when name is acquired, or `NULL` to ignore

name_lost_closure

closure to invoke when name is lost, or `NULL` to ignore

Returns:

an identifier (never 0) that can be used with [func@Gio.bus_unown_name] to stop owning the name.


Namespace: GLib.Bus
Package: gio-2.0