DBusConnection

constructor(res: AsyncResult)

Finishes an operation started with g_dbus_connection_new().

Return

a #GDBusConnection or null if @error is set. Free with g_object_unref().

Since

2.26

Parameters

res

a #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().


constructor(address: String, flags: DBusConnectionFlags, observer: DBusAuthObserver? = null, cancellable: Cancellable? = null)

Synchronously 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_sync() 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.

This is a synchronous failable constructor. See g_dbus_connection_new_for_address() for the asynchronous version.

If @observer is not null it may be used to control the authentication process.

Return

a #GDBusConnection or null if @error is set. Free with g_object_unref().

Since

2.26

Parameters

address

a D-Bus address

flags

flags describing how to make the connection

observer

a #GDBusAuthObserver or null

cancellable

a #GCancellable or null


constructor(stream: IOStream, guid: String? = null, flags: DBusConnectionFlags, observer: DBusAuthObserver? = null, cancellable: Cancellable? = null)

Synchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by @stream.

If @stream is a #GSocketConnection, then the corresponding #GSocket will be put into non-blocking mode.

The D-Bus connection will interact with @stream from a worker thread. As a result, the caller should not interact with @stream after this method has been called, except by calling g_object_unref() on it.

If @observer is not null it may be used to control the authentication process.

This is a synchronous failable constructor. See g_dbus_connection_new() for the asynchronous version.

Return

a #GDBusConnection or null if @error is set. Free with g_object_unref().

Since

2.26

Parameters

stream

a #GIOStream

guid

the GUID to use if authenticating as a server or null

flags

flags describing how to make the connection

observer

a #GDBusAuthObserver or null

cancellable

a #GCancellable or null


constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)