DBusServer.newSync

Creates a new D-Bus server that listens on the first address in address that works.

Once constructed, you can use gio.dbus_server.DBusServer.getClientAddress to get a D-Bus address string that clients can use to connect.

To have control over the available authentication mechanisms and the users that are authorized to connect, it is strongly recommended to provide a non-null #GDBusAuthObserver.

Connect to the #GDBusServer::new-connection signal to handle incoming connections.

The returned #GDBusServer isn't active - you have to start it with gio.dbus_server.DBusServer.start.

#GDBusServer is used in this example[gdbus-peer-to-peer].

This is a synchronous failable constructor. There is currently no asynchronous version.

Parameters

address string

A D-Bus address.

flags gio.types.DBusServerFlags

Flags from the #GDBusServerFlags enumeration.

guid string

A D-Bus GUID.

observer gio.dbus_auth_observer.DBusAuthObserver

A #GDBusAuthObserver or null.

cancellable gio.cancellable.Cancellable

A #GCancellable or null.

Return Value

Type: gio.dbus_server.DBusServer

A #GDBusServer or null if error is set. Free with gobject.object.ObjectG.unref.