gio.dbus_server
Module for [DBusServer] class
Types 3
[gio.dbus_server.DBusServer] is a helper for listening to and accepting D-Bus connections. This can be used to create a new D-Bus server, allowing two peers to use the D-Bus protocol for their own specialized communication. A server instance provided in this way will not perform message routing or implement the
org.freedesktop.DBus interface.
To just export an object on a well-known name on a message bus, such as the session or system bus, you should instead use func@Gio.bus_own_name.
An example of peer-to-peer communication with GDBus can be found in gdbus-example-peer.c.
Note that a minimal [gio.dbus_server.DBusServer] will accept connections from any peer. In many use-cases it will be necessary to add a [gio.dbus_auth_observer.DBusAuthObserver] that only accepts connections that have successfully authenticated as the same user that is running the [gio.dbus_server.DBusServer]. Since GLib 2.68 this can be achieved more simply by passing the [gio.types.DBusServerFlags.AuthenticationRequireSameUser] flag to the server.
DBusServer self()Returns `this`, for use in `with` statements.DBusServerGidBuilder builder()Get builder for [gio.dbus_server.DBusServer] Returns: New builder objectgio.dbus_auth_observer.DBusAuthObserver authenticationObserver() @propertyGet `authenticationObserver` property. Returns: A #GDBusAuthObserver object to assist in the authentication process or null.string clientAddress() @propertyGet `clientAddress` property. Returns: The D-Bus address that clients can use.gio.types.DBusServerFlags flags() @propertyGet `flags` property. Returns: Flags from the #GDBusServerFlags enumeration.gio.dbus_server.DBusServer newSync(string address, gio.types.DBusServerFlags flags, string guid, gio.dbus_auth_observer.DBusAuthObserver observer = null, gio.cancellable.Cancellable cancellable = null)Creates a new D-Bus server that listens on the first address in address that works.string getClientAddress()Gets a [D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses) string that can be used by clients to connect to server.gio.types.DBusServerFlags getFlags()Gets the flags for server. Returns: A set of flags from the #GDBusServerFlags enumeration.string getGuid()Gets the GUID for server, as provided to [gio.dbus_server.DBusServer.newSync]. Returns: A D-Bus GUID. Do not free this string, it is owned by server.bool isActive()Gets whether server is active. Returns: true if server is active, false otherwise.void start()Starts server.void stop()Stops server.gulong connectNewConnection(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.dbus_connection.DBusConnection)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.dbus_server.DBusServer)))
&& Parameters!T.length < 3)Connect to `NewConnection` signal.T address(string propval)Set `address` property. Params: propval = The D-Bus address to listen on. Returns: Builder instance for fluent chainingT authenticationObserver(gio.dbus_auth_observer.DBusAuthObserver propval)Set `authenticationObserver` property. Params: propval = A #GDBusAuthObserver object to assist in the authentication process or null. Returns: Builder instance for fluent chainingT flags(gio.types.DBusServerFlags propval)Set `flags` property. Params: propval = Flags from the #GDBusServerFlags enumeration. Returns: Builder instance for fluent chainingT guid(string propval)Set `guid` property. Params: propval = The GUID of the server.Fluent builder for [gio.dbus_server.DBusServer]