Gio.DBusConnection.new

function new(stream: Gio.IOStream, guid: String, flags: Gio.DBusConnectionFlags, observer: Gio.DBusAuthObserver, cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void {
    // Gjs wrapper for g_dbus_connection_new()
}
  

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

If stream is a Gio.SocketConnection, then the corresponding Gio.Socket 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 GObject.Object.prototype.unref on it.

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

When the operation is finished, callback will be invoked. You can then call Gio.DBusConnection.new_finish to get the result of the operation.

This is a asynchronous failable constructor. See Gio.DBusConnection.new_sync for the synchronous version.

Since 2.26

stream

a Gio.IOStream

guid

the GUID to use if a authenticating as a server or null

flags

flags describing how to make the connection

observer

a Gio.DBusAuthObserver or null

cancellable

a Gio.Cancellable or null

callback

a Gio.AsyncReadyCallback to call when the request is satisfied