Adds a message filter. Filters are handlers that are run on all incoming and outgoing messages, prior to standard dispatch. Filters are run in the order that they were added. The same handler can be added as a filter more than once, in which case it will be run more than once. Filters added during a filter callback won't be run on the message being processed. Filter functions are allowed to modify and even drop messages.
Asynchronously invokes the method_name method on the interface_name D-Bus interface on the remote object at object_path owned by bus_name.
Finishes an operation started with gio.dbus_connection.DBusConnection.call.
Synchronously invokes the method_name method on the interface_name D-Bus interface on the remote object at object_path owned by bus_name.
Like gio.dbus_connection.DBusConnection.call but also takes a #GUnixFDList object.
Finishes an operation started with gio.dbus_connection.DBusConnection.callWithUnixFdList.
Like gio.dbus_connection.DBusConnection.callSync but also takes and returns #GUnixFDList objects. See gio.dbus_connection.DBusConnection.callWithUnixFdList and gio.dbus_connection.DBusConnection.callWithUnixFdListFinish for more details.
Closes connection. Note that this never causes the process to exit (this might only happen if the other end of a shared message bus connection disconnects, see #GDBusConnection:exit-on-close).
Finishes an operation started with gio.dbus_connection.DBusConnection.close.
Synchronously closes connection. The calling thread is blocked until this is done. See gio.dbus_connection.DBusConnection.close for the asynchronous version of this method and more details about what it does.
Connect to Closed signal.
Emits a signal.
Exports action_group on connection at object_path.
Exports menu on connection at object_path.
Asynchronously flushes connection, that is, writes all queued outgoing message to the transport and then flushes the transport (using gio.output_stream.OutputStream.flushAsync). This is useful in programs that wants to emit a D-Bus signal and then exit immediately. Without flushing the connection, there is no guaranteed that the message has been sent to the networking buffers in the OS kernel.
Finishes an operation started with gio.dbus_connection.DBusConnection.flush.
Synchronously flushes connection. The calling thread is blocked until this is done. See gio.dbus_connection.DBusConnection.flush for the asynchronous version of this method and more details about what it does.
Gets the capabilities negotiated with the remote peer
Gets whether the process is terminated when connection is closed by the remote peer. See #GDBusConnection:exit-on-close for more details.
Gets the flags used to construct this connection
The GUID of the peer performing the role of server when authenticating. See #GDBusConnection:guid for more details.
Retrieves the last serial number assigned to a #GDBusMessage on the current thread. This includes messages sent via both low-level API such as gio.dbus_connection.DBusConnection.sendMessage as well as high-level API such as gio.dbus_connection.DBusConnection.emitSignal, gio.dbus_connection.DBusConnection.call or gio.dbus_proxy.DBusProxy.call.
Gets the credentials of the authenticated peer. This will always return null unless connection acted as a server (e.g. gio.types.DBusConnectionFlags.AuthenticationServer was passed) when set up and the client passed credentials as part of the authentication process.
Gets the underlying stream used for IO.
Gets the unique name of connection as assigned by the message bus. This can also be used to figure out if connection is a message bus connection.
Gets whether connection is closed.
Version of gio.dbus_connection.DBusConnection.registerObject using closures instead of a #GDBusInterfaceVTable for easier binding in other languages.
Registers a whole subtree of dynamic objects.
Removes a filter.
Asynchronously sends message to the peer represented by connection.
Asynchronously sends message to the peer represented by connection.
Finishes an operation started with gio.dbus_connection.DBusConnection.sendMessageWithReply.
Synchronously sends message to the peer represented by connection and blocks the calling thread until a reply is received or the timeout is reached. See gio.dbus_connection.DBusConnection.sendMessageWithReply for the asynchronous version of this method.
Sets whether the process should be terminated when connection is closed by the remote peer. See #GDBusConnection:exit-on-close for more details.
Subscribes to signals on connection and invokes callback whenever the signal is received. Note that callback will be invoked in the [thread-default main context][g-main-context-push-thread-default] of the thread you are calling this method from.
Unsubscribes from signals.
If connection was created with gio.types.DBusConnectionFlags.DelayMessageProcessing, this method starts processing messages. Does nothing on if connection wasn't created with this flag or if the method has already been called.
Reverses the effect of a previous call to gio.dbus_connection.DBusConnection.exportActionGroup.
Reverses the effect of a previous call to gio.dbus_connection.DBusConnection.exportMenuModel.
Unregisters an object.
Unregisters a subtree.
Finishes an operation started with gio.dbus_connection.DBusConnection.new_.
Asynchronously connects and sets up a D-Bus client connection for exchanging D-Bus messages with an endpoint specified by address which must be in the D-Bus address format.
Finishes an operation started with gio.dbus_connection.DBusConnection.newForAddress.
Synchronously connects and sets up a D-Bus client connection for exchanging D-Bus messages with an endpoint specified by address which must be in the D-Bus address format.
Synchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by stream.
Asynchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by stream.
Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after initial construction. If the object also implements #GInitable you can optionally call gio.initable.Initable.init_ instead.
Finishes asynchronous initialization and returns the result. See gio.async_initable.AsyncInitable.initAsync.
Finishes the async construction for the various g_async_initable_new calls, returning the created object or null on error.
Initializes the object implementing the interface.
Set the GObject of a D ObjectG wrapper.
Get a pointer to the underlying C object.
Calls g_object_ref() on a GObject.
Calls g_object_unref() on a GObject.
Get the GType of an object.
GObject GType property.
Convenience method to return this cast to a type. For use in D with statements.
Template to get the D object from a C GObject and cast it to the given D object type.
Connect a D closure to an object signal.
Template for setting a GObject property.
Template for getting a GObject property.
Creates a binding between source_property on source and target_property on target.
Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.
This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectG.refSink.
Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.
Gets a named field from the objects table of associations (see gobject.object.ObjectG.setData).
Gets a property of an object.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata.
Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.
Checks whether object has a floating[floating-ref] reference.
Emits a "notify" signal for the property property_name on object.
Emits a "notify" signal for the property specified by pspec on object.
Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.
Releases all references to other objects. This can be used to break reference cycles.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
Sets a property on an object.
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:
Reverts the effect of a previous call to gobject.object.ObjectG.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.
This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectG.ref_ and gobject.object.ObjectG.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.
Connect to Notify signal.
Helper function for constructing #GAsyncInitable object. This is similar to gobject.object.ObjectG.newv but also initializes the object asynchronously.
Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after initial construction. If the object also implements #GInitable you can optionally call gio.initable.Initable.init_ instead.
Finishes asynchronous initialization and returns the result. See gio.async_initable.AsyncInitable.initAsync.
Finishes the async construction for the various g_async_initable_new calls, returning the created object or null on error.
Initializes the object implementing the interface.
The gio.dbus_connection.DBusConnection type is used for D-Bus connections to remote peers such as a message buses.
It is a low-level API that offers a lot of flexibility. For instance, it lets you establish a connection over any transport that can by represented as a gio.iostream.IOStream.
This class is rarely used directly in D-Bus clients. If you are writing a D-Bus client, it is often easier to use the func@Gio.bus_own_name, func@Gio.bus_watch_name or gio.dbus_proxy.DBusProxy.newForBus APIs.
As an exception to the usual GLib rule that a particular object must not be used by two threads at the same time, gio.dbus_connection.DBusConnections methods may be called from any thread. This is so that func@Gio.bus_get and func@Gio.bus_get_sync can safely return the same gio.dbus_connection.DBusConnection when called from any thread.
Most of the ways to obtain a gio.dbus_connection.DBusConnection automatically initialize it (i.e. connect to D-Bus): for instance, gio.dbus_connection.DBusConnection.new_ and func@Gio.bus_get, and the synchronous versions of those methods, give you an initialized connection. Language bindings for GIO should use gio.initable.Initable.new_ or gio.async_initable.AsyncInitable.newAsync, which also initialize the connection.
If you construct an uninitialized gio.dbus_connection.DBusConnection, such as via gobject.object.ObjectG.new_, you must initialize it via gio.initable.Initable.init_ or gio.async_initable.AsyncInitable.initAsync before using its methods or properties. Calling methods or accessing properties on a gio.dbus_connection.DBusConnection that has not completed initialization successfully is considered to be invalid, and leads to undefined behaviour. In particular, if initialization fails with a glib.error.ErrorG, the only valid thing you can do with that gio.dbus_connection.DBusConnection is to free it with gobject.object.ObjectG.unref.
An example D-Bus server
Here is an example for a D-Bus server: gdbus-example-server.c
An example for exporting a subtree
Here is an example for exporting a subtree: gdbus-example-subtree.c
An example for file descriptor passing
Here is an example for passing UNIX file descriptors: gdbus-unix-fd-client.c
An example for exporting a GObject
Here is an example for exporting a #GObject: gdbus-example-export.c