Gio.DBusConnection.new_sync
function new_sync(stream: Gio.IOStream, guid: String, flags: Gio.DBusConnectionFlags, observer: Gio.DBusAuthObserver, cancellable: Gio.Cancellable): Gio.DBusConnection { // Gjs wrapper for g_dbus_connection_new_sync() }
Synchronously 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.
This is a synchronous failable constructor. See Gio.DBusConnection.new for the asynchronous version.
Since 2.26
- stream
- 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
- Returns
a Gio.DBusConnection or null if @error is set. Free with GObject.Object.prototype.unref.