DBusServer
GDBusServer
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 GDBusServer
will accept connections from any peer. In many use-cases it will be necessary to add a class@Gio.DBusAuthObserver that only accepts connections that have successfully authenticated as the same user that is running the GDBusServer
. Since GLib 2.68 this can be achieved more simply by passing the G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER
flag to the server.
Skipped during bindings generation
method
active
: Property has no getter nor settermethod
address
: Property has no getter nor settermethod
authentication-observer
: Property has no getter nor setter
Since
2.26
Constructors
Creates a new D-Bus server that listens on the first address in
Properties
Functions
Emitted when a new authenticated connection has been made. Use g_dbus_connection_get_peer_credentials() to figure out what identity (if any), was authenticated.
Gets a D-Bus address string that can be used by clients to connect to @server.
Gets the flags for @server.
Initializes the object implementing the interface.