Gio.DBusServer.new_sync

function new_sync(address: String, flags: Gio.DBusServerFlags, guid: String, observer: Gio.DBusAuthObserver, cancellable: Gio.Cancellable): Gio.DBusServer {
    // Gjs wrapper for g_dbus_server_new_sync()
}
  

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

Once constructed, you can use Gio.DBusServer.prototype.get_client_address to get a D-Bus address string that clients can use to connect.

Connect to the Gio.DBusServer::new-connection signal to handle incoming connections.

The returned Gio.DBusServer isn't active - you have to start it with Gio.DBusServer.prototype.start.

Gio.DBusServer is used in this [example][gdbus-peer-to-peer].

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

Since 2.26

address

A D-Bus address.

flags

Flags from the Gio.DBusServerFlags enumeration.

guid

A D-Bus GUID.

observer

A Gio.DBusAuthObserver or null.

cancellable

A Gio.Cancellable or null.

Returns

A Gio.DBusServer or null if @error is set. Free with GObject.Object.prototype.unref.