DBusConnection.newSync

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 gobject.object.ObjectG.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.dbus_connection.DBusConnection.new_ for the asynchronous version.

Parameters

stream gio.iostream.IOStream

a #GIOStream

guid string

the GUID to use if authenticating as a server or null

flags gio.types.DBusConnectionFlags

flags describing how to make the connection

observer gio.dbus_auth_observer.DBusAuthObserver

a #GDBusAuthObserver or null

cancellable gio.cancellable.Cancellable

a #GCancellable or null

Return Value

Type: gio.dbus_connection.DBusConnection

a #GDBusConnection or null if error is set. Free with gobject.object.ObjectG.unref.