1.15 <GDBusConnection>

Class: <GDBusConnection>

It derives from <GObject>.

The <GDBusConnection> 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 <GIOStream>.

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 bus-own-name, bus-watch-name or dbus-proxy:new-for-bus APIs.

As an exception to the usual GLib rule that a particular object must not be used by two threads at the same time, <GDBusConnection>s methods may be called from any thread. This is so that bus-get and bus-get-sync can safely return the same <GDBusConnection> when called from any thread.

Most of the ways to obtain a <GDBusConnection> automatically initialize it (i.e. connect to D-Bus): for instance, dbus-connection:new and bus-get, and the synchronous versions of those methods, give you an initialized connection. Language bindings for GIO should use Gio.Initable.new or Gio.AsyncInitable.new_async, which also initialize the connection.

If you construct an uninitialized <GDBusConnection>, such as via GObject.Object.new, you must initialize it via initable:init? or async-initable:init-async before using its methods or properties. Calling methods or accessing properties on a <GDBusConnection> that has not completed initialization successfully is considered to be invalid, and leads to undefined behaviour. In particular, if initialization fails with a <GError>, the only valid thing you can do with that <GDBusConnection> is to free it with object: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

Properties

Property: dbus-connection:address self

A D-Bus address specifying potential endpoints that can be used when establishing the connection.

Its value is a string, or #f.

It can only be set when the object is made, with #:address. It cannot be read.

Property: dbus-connection:authentication-observer self

A <GDBusAuthObserver> object to assist in the authentication process or #f.

Its value is a <GDBusAuthObserver>, or #f.

It can only be set when the object is made, with #:authentication-observer. It cannot be read.

Property: dbus-connection:capabilities self

Flags from the <GDBusCapabilityFlags> enumeration representing connection features negotiated with the other peer.

Its value is a <GDBusCapabilityFlags>.

It is read only.

Property: dbus-connection:closed self

A boolean specifying whether the connection has been closed.

Its value is a boolean.

It is read only.

Property: dbus-connection:exit-on-close self

A boolean specifying whether the process will be terminated (by calling raise(SIGTERM)) if the connection is closed by the remote peer.

Note that <GDBusConnection> objects returned by bus-get-finish and bus-get-sync will (usually) have this property set to #t.

Its value is a boolean.

Set it with (set! (dbus-connection:exit-on-close self) value).

Property: dbus-connection:flags self

Flags from the <GDBusConnectionFlags> enumeration.

Its value is a <GDBusConnectionFlags> (or, to set it, a list of its symbols, or one of them).

It can only be set when the object is made, with #:flags.

Property: dbus-connection:guid self

The GUID of the peer performing the role of server when authenticating.

If you are constructing a <GDBusConnection> and pass authentication-server in the dbus-connection:flags property then you must also set this property to a valid guid.

If you are constructing a <GDBusConnection> and pass authentication-client in the dbus-connection:flags property you will be able to read the GUID of the other peer here after the connection has been successfully initialized.

Note that the D-Bus specification uses the term ‘UUID’ to refer to this, whereas GLib consistently uses the term ‘GUID’ for historical reasons.

Despite its name, the format of dbus-connection:guid does not follow RFC 4122 or the Microsoft GUID format.

Its value is a string, or #f.

It can only be set when the object is made, with #:guid.

Property: dbus-connection:stream self

The underlying <GIOStream> used for I/O.

If this is passed on construction and is a <GSocketConnection>, then the corresponding <GSocket> will be put into non-blocking mode.

While the <GDBusConnection> is active, it will interact with this stream from a worker thread, so it is not safe to interact with the stream directly.

Its value is a <GIOStream>, or #f.

It can only be set when the object is made, with #:stream.

Property: dbus-connection:unique-name self

The unique name as assigned by the message bus or #f if the connection is not open or not a message bus connection.

Its value is a string, or #f.

It is read only.

Procedures

Method: dbus-connection:add-filter self filter-function ⇒ %return
Method: add-filter self filter-function ⇒ %return

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.

Note that filters are run in a dedicated message handling thread so they can’t block and, generally, can’t do anything but signal a worker thread. Also note that filters are rarely needed - use API such as dbus-connection:send-message-with-reply, dbus-connection:signal-subscribe or dbus-connection:call instead.

If a filter consumes an incoming message the message is not dispatched anywhere else - not even the standard dispatch machinery (that API such as dbus-connection:signal-subscribe and dbus-connection:send-message-with-reply relies on) will see the message. Similarly, if a filter consumes an outgoing message, the message will not be sent to the other peer.

If user-data-free-func is non-#f, it will be called (in the thread-default main context of the thread you are calling this method from) at some point after user-data is no longer needed. (It is not guaranteed to be called synchronously when the filter is removed, and may be called after self has been destroyed.)

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

filter-function

Passed: a procedure.

a filter function

See GDBusMessageFilterFunction for how it is called.

%return

Returned: an unsigned 32-bit integer.

a filter identifier that can be used with dbus-connection:remove-filter

user-data

Not passed: guile-gi supplies it.

user data to pass to filter-function

user-data-free-func

Not passed: guile-gi supplies it.

function to free user-data with when filter is removed or #f

See GDestroyNotify for how it is called.

Method: dbus-connection:call self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [cancellable] [callback]
Method: call self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [cancellable] [callback]

Asynchronously invokes the method-name method on the interface-name D-Bus interface on the remote object at object-path owned by bus-name.

If self is closed then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with invalid-argument.

If reply-type is non-#f then the reply will be checked for having this type and an error will be raised if it does not match. Said another way, if you give a reply-type then any non-#f return value will be of this type. Unless it’s G_VARIANT_TYPE_UNIT, the reply-type will be a tuple containing one or more values.

If the parameters <GVariant> is floating, it is consumed. This allows convenient ’inline’ use of g_variant_new(), e.g.:


 g_dbus_connection_call (connection,
                         "org.freedesktop.StringThings",
                         "/org/freedesktop/StringThings",
                         "org.freedesktop.StringThings",
                         "TwoStrings",
                         g_variant_new ("(ss)",
                                        "Thing One",
                                        "Thing Two"),
                         NULL,
                         G_DBUS_CALL_FLAGS_NONE,
                         -1,
                         NULL,
                         (GAsyncReadyCallback) two_strings_done,
                         NULL);

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-connection:call-finish to get the result of the operation. See dbus-connection:call-sync for the synchronous version of this function.

If callback is #f then the D-Bus method call message will be sent with the no-reply-expected flag set.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

bus-name

Passed: a string, or #f.

a unique or well-known bus name or #f if self is not a message bus connection

object-path

Passed: a string.

path of remote object

interface-name

Passed: a string.

D-Bus interface to invoke method on

method-name

Passed: a string.

the name of the method to invoke

parameters

Passed: a <GVariant>, or #f.

a <GVariant> tuple with parameters for the method or #f if not passing parameters

reply-type

Passed: a <GVariantType>, or #f.

the expected type of the reply (which will be a tuple), or #f

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

flags from the <GDBusCallFlags> enumeration

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result of the method invocation

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback

Method: dbus-connection:call-finish self res ⇒ %return
Method: call-finish self res ⇒ %return

Finishes an operation started with dbus-connection:call.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:call

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a non-floating <GVariant> tuple with return values. Free with variant:unref.

Method: dbus-connection:call-sync self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [cancellable] ⇒ %return
Method: call-sync self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [cancellable] ⇒ %return

Synchronously invokes the method-name method on the interface-name D-Bus interface on the remote object at object-path owned by bus-name.

If self is closed then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If parameters contains a value not compatible with the D-Bus protocol, the operation fails with invalid-argument.

If reply-type is non-#f then the reply will be checked for having this type and an error will be raised if it does not match. Said another way, if you give a reply-type then any non-#f return value will be of this type.

If the parameters <GVariant> is floating, it is consumed. This allows convenient ’inline’ use of g_variant_new(), e.g.:


 g_dbus_connection_call_sync (connection,
                              "org.freedesktop.StringThings",
                              "/org/freedesktop/StringThings",
                              "org.freedesktop.StringThings",
                              "TwoStrings",
                              g_variant_new ("(ss)",
                                             "Thing One",
                                             "Thing Two"),
                              NULL,
                              G_DBUS_CALL_FLAGS_NONE,
                              -1,
                              NULL,
                              &error);

The calling thread is blocked until a reply is received. See dbus-connection:call for the asynchronous version of this method.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

bus-name

Passed: a string, or #f.

a unique or well-known bus name or #f if self is not a message bus connection

object-path

Passed: a string.

path of remote object

interface-name

Passed: a string.

D-Bus interface to invoke method on

method-name

Passed: a string.

the name of the method to invoke

parameters

Passed: a <GVariant>, or #f.

a <GVariant> tuple with parameters for the method or #f if not passing parameters

reply-type

Passed: a <GVariantType>, or #f.

the expected type of the reply, or #f

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

flags from the <GDBusCallFlags> enumeration

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a non-floating <GVariant> tuple with return values. Free with variant:unref.

Method: dbus-connection:call-with-unix-fd-list self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [fd-list] [cancellable] [callback]
Method: call-with-unix-fd-list self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [fd-list] [cancellable] [callback]

Like dbus-connection:call but also takes a <GUnixFDList> object.

The file descriptors normally correspond to G_VARIANT_TYPE_HANDLE values in the body of the message. For example, if a message contains two file descriptors, fd-list would have length 2, and g_variant_new_handle (0) and g_variant_new_handle (1) would appear somewhere in the body of the message (not necessarily in that order!) to represent the file descriptors at indexes 0 and 1 respectively.

When designing D-Bus APIs that are intended to be interoperable, please note that non-GDBus implementations of D-Bus can usually only access file descriptors if they are referenced in this way by a value of type G_VARIANT_TYPE_HANDLE in the body of the message.

This method is only available on UNIX.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

bus-name

Passed: a string, or #f.

a unique or well-known bus name or #f if self is not a message bus connection

object-path

Passed: a string.

path of remote object

interface-name

Passed: a string.

D-Bus interface to invoke method on

method-name

Passed: a string.

the name of the method to invoke

parameters

Passed: a <GVariant>, or #f.

a <GVariant> tuple with parameters for the method or #f if not passing parameters

reply-type

Passed: a <GVariantType>, or #f.

the expected type of the reply, or #f

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

flags from the <GDBusCallFlags> enumeration

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

fd-list

Passed, or left out: a <GUnixFDList>, or #f.

a <GUnixFDList> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied or #f if you don’t * care about the result of the method invocation

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback.

Method: dbus-connection:call-with-unix-fd-list-finish self res ⇒ %return out-fd-list
Method: call-with-unix-fd-list-finish self res ⇒ %return out-fd-list

Finishes an operation started with dbus-connection:call-with-unix-fd-list.

The file descriptors normally correspond to G_VARIANT_TYPE_HANDLE values in the body of the message. For example, if variant:get-handle returns 5, that is intended to be a reference to the file descriptor that can be accessed by g_unix_fd_list_get (*out_fd_list, 5, ...).

When designing D-Bus APIs that are intended to be interoperable, please note that non-GDBus implementations of D-Bus can usually only access file descriptors if they are referenced in this way by a value of type G_VARIANT_TYPE_HANDLE in the body of the message.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:call-with-unix-fd-list

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a non-floating <GVariant> tuple with return values. Free with variant:unref.

out-fd-list

Returned: a <GUnixFDList>, or #f.

return location for a <GUnixFDList> or #f

Method: dbus-connection:call-with-unix-fd-list-sync self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [fd-list] [cancellable] ⇒ %return out-fd-list
Method: call-with-unix-fd-list-sync self bus-name object-path interface-name method-name parameters reply-type flags timeout-msec [fd-list] [cancellable] ⇒ %return out-fd-list

Like dbus-connection:call-sync but also takes and returns <GUnixFDList> objects. See dbus-connection:call-with-unix-fd-list and dbus-connection:call-with-unix-fd-list-finish for more details.

This method is only available on UNIX.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

bus-name

Passed: a string, or #f.

a unique or well-known bus name or #f if self is not a message bus connection

object-path

Passed: a string.

path of remote object

interface-name

Passed: a string.

D-Bus interface to invoke method on

method-name

Passed: a string.

the name of the method to invoke

parameters

Passed: a <GVariant>, or #f.

a <GVariant> tuple with parameters for the method or #f if not passing parameters

reply-type

Passed: a <GVariantType>, or #f.

the expected type of the reply, or #f

flags

Passed: a <GDBusCallFlags>, or a list of its symbols, or one of them.

flags from the <GDBusCallFlags> enumeration

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

fd-list

Passed, or left out: a <GUnixFDList>, or #f.

a <GUnixFDList> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a <GVariant>.

#f if error is set. Otherwise a non-floating <GVariant> tuple with return values. Free with variant:unref.

out-fd-list

Returned: a <GUnixFDList>, or #f.

return location for a <GUnixFDList> or #f

Method: dbus-connection:close self [cancellable] [callback]
Method: close self [cancellable] [callback]

Closes self. 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 dbus-connection:exit-on-close).

Once the connection is closed, operations such as sending a message will return with the error closed. Closing a connection will not automatically flush the connection so queued messages may be lost. Use dbus-connection:flush if you need such guarantees.

If self is already closed, this method fails with closed.

When self has been closed, the dbus-connection:closed signal is emitted in the thread-default main context (see main-context:push-thread-default) of the thread that self was constructed in.

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-connection:close-finish? to get the result of the operation. See dbus-connection:close-sync? for the synchronous version.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback

Method: dbus-connection:close-finish? self res ⇒ %return
Method: close-finish? self res ⇒ %return

Finishes an operation started with dbus-connection:close.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:close

%return

Returned: a boolean.

#t if the operation succeeded, #f if error is set

Method: dbus-connection:close-sync? self [cancellable] ⇒ %return
Method: close-sync? self [cancellable] ⇒ %return

Synchronously closes self. The calling thread is blocked until this is done. See dbus-connection:close for the asynchronous version of this method and more details about what it does.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a boolean.

#t if the operation succeeded, #f if error is set

Method: dbus-connection:emit-signal? self destination-bus-name object-path interface-name signal-name [parameters] ⇒ %return
Method: emit-signal? self destination-bus-name object-path interface-name signal-name [parameters] ⇒ %return

Emits a signal.

If the parameters GVariant is floating, it is consumed.

This can only fail if parameters is not compatible with the D-Bus protocol (invalid-argument), or if self has been closed (closed).

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

destination-bus-name

Passed: a string, or #f.

the unique bus name for the destination for the signal or #f to emit to all listeners

object-path

Passed: a string.

path of remote object

interface-name

Passed: a string.

D-Bus interface to emit a signal on

signal-name

Passed: a string.

the name of the signal to emit

parameters

Passed, or left out: a <GVariant>, or #f.

a <GVariant> tuple with parameters for the signal or #f if not passing parameters

%return

Returned: a boolean.

#t unless error is set

Method: dbus-connection:export-action-group self object-path action-group ⇒ %return
Method: export-action-group self object-path action-group ⇒ %return

Exports action-group on self at object-path.

The implemented D-Bus API should be considered private. It is subject to change in the future.

A given object path can only have one action group exported on it. If this constraint is violated, the export will fail and 0 will be returned (with error set accordingly).

You can unexport the action group using dbus-connection:unexport-action-group with the return value of this function.

The thread default main context is taken at the time of this call. All incoming action activations and state change requests are reported from this context. Any changes on the action group that cause it to emit signals must also come from this same context. Since incoming action activations and state change requests are rather likely to cause changes on the action group, this effectively limits a given action group to being exported from only one main context.

self

Passed: a <GDBusConnection>.

the D-Bus connection

object-path

Passed: a string.

a D-Bus object path

action-group

Passed: a <GActionGroup>.

an action group

%return

Returned: an unsigned 32-bit integer.

the ID of the export (never zero), or 0 in case of failure

Method: dbus-connection:export-menu-model self object-path menu ⇒ %return
Method: export-menu-model self object-path menu ⇒ %return

Exports menu on self at object-path.

The implemented D-Bus API should be considered private. It is subject to change in the future.

An object path can only have one menu model exported on it. If this constraint is violated, the export will fail and 0 will be returned (with error set accordingly).

Exporting menus with sections containing more than G_MENU_EXPORTER_MAX_SECTION_SIZE items is not supported and results in undefined behavior.

You can unexport the menu model using dbus-connection:unexport-menu-model with the return value of this function.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

object-path

Passed: a string.

a D-Bus object path

menu

Passed: a <GMenuModel>.

a <GMenuModel>

%return

Returned: an unsigned 32-bit integer.

the ID of the export (never zero), or 0 in case of failure

Method: dbus-connection:flush self [cancellable] [callback]
Method: flush self [cancellable] [callback]

Asynchronously flushes self, that is, writes all queued outgoing messages to the transport and then flushes the transport (using output-stream:flush-async). This is useful in programs that want to emit a D-Bus signal and then exit immediately. Without flushing the connection, there is no guarantee that the message has been sent to the networking buffers in the OS kernel.

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-connection:flush-finish? to get the result of the operation. See dbus-connection:flush-sync? for the synchronous version.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback

Method: dbus-connection:flush-finish? self res ⇒ %return
Method: flush-finish? self res ⇒ %return

Finishes an operation started with dbus-connection:flush.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:flush

%return

Returned: a boolean.

#t if the operation succeeded, #f if error is set

Method: dbus-connection:flush-sync? self [cancellable] ⇒ %return
Method: flush-sync? self [cancellable] ⇒ %return

Synchronously flushes self. The calling thread is blocked until this is done. See dbus-connection:flush for the asynchronous version of this method and more details about what it does.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a boolean.

#t if the operation succeeded, #f if error is set

Method: dbus-connection:get-capabilities self ⇒ %return
Method: get-capabilities self ⇒ %return

Gets the capabilities negotiated with the remote peer

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a <GDBusCapabilityFlags>.

zero or more flags from the <GDBusCapabilityFlags> enumeration

Method: dbus-connection:get-exit-on-close? self ⇒ %return
Method: get-exit-on-close? self ⇒ %return

Gets whether the process is terminated when self is closed by the remote peer. See dbus-connection:exit-on-close for more details.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a boolean.

whether the process is terminated when self is closed by the remote peer

Method: dbus-connection:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the flags used to construct this connection

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a <GDBusConnectionFlags>.

zero or more flags from the <GDBusConnectionFlags> enumeration

Method: dbus-connection:get-guid self ⇒ %return
Method: get-guid self ⇒ %return

The GUID of the peer performing the role of server when authenticating. See dbus-connection:guid for more details.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a string.

The GUID. Do not free this string, it is owned by self.

Method: dbus-connection:get-last-serial self ⇒ %return
Method: get-last-serial self ⇒ %return

Retrieves the last serial number assigned to a <GDBusMessage> on the current thread. This includes messages sent via both low-level API such as dbus-connection:send-message as well as high-level API such as dbus-connection:emit-signal?, dbus-connection:call or dbus-proxy:call.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: an unsigned 32-bit integer.

the last used serial or zero when no message has been sent within the current thread

Method: dbus-connection:get-peer-credentials self ⇒ %return
Method: get-peer-credentials self ⇒ %return

Gets the credentials of the authenticated peer. This will always return #f unless self acted as a server (e.g. authentication-server was passed) when set up and the client passed credentials as part of the authentication process.

In a message bus setup, the message bus is always the server and each application is a client. So this method will always return #f for message bus clients.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a <GCredentials>, or #f.

a <GCredentials> or #f if not available. Do not free this object, it is owned by self.

Method: dbus-connection:get-stream self ⇒ %return
Method: get-stream self ⇒ %return

Gets the underlying stream used for IO.

While the <GDBusConnection> is active, it will interact with this stream from a worker thread, so it is not safe to interact with the stream directly.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a <GIOStream>.

the stream used for IO

Method: dbus-connection:get-unique-name self ⇒ %return
Method: get-unique-name self ⇒ %return

Gets the unique name of self as assigned by the message bus. This can also be used to figure out if self is a message bus connection.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a string, or #f.

the unique name or #f if self is not a message bus connection. Do not free this string, it is owned by self.

Method: dbus-connection:is-closed? self ⇒ %return
Method: is-closed? self ⇒ %return

Gets whether self is closed.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

%return

Returned: a boolean.

#t if the connection is closed, #f otherwise

Procedure: dbus-connection:new stream guid flags [observer] [cancellable] [callback]

Asynchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by stream.

If stream is a <GSocketConnection>, then the corresponding <GSocket> will be put into non-blocking mode.

The D-Bus connection will interact with stream from a worker thread. As a result, the caller should not interact with stream after this method has been called, except by calling object:unref on it.

If observer is not #f it may be used to control the authentication process.

When the operation is finished, callback will be invoked. You can then call dbus-connection:new-finish to get the result of the operation.

This is an asynchronous failable constructor. See dbus-connection:new-sync for the synchronous version.

stream

Passed: a <GIOStream>.

a <GIOStream>

guid

Passed: a string, or #f.

the GUID to use if authenticating as a server or #f

flags

Passed: a <GDBusConnectionFlags>, or a list of its symbols, or one of them.

flags describing how to make the connection

observer

Passed, or left out: a <GDBusAuthObserver>, or #f.

a <GDBusAuthObserver> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback

Procedure: dbus-connection:new-finish res ⇒ %return

Finishes an operation started with dbus-connection:new.

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:new.

%return

Returned: a <GDBusConnection>.

a <GDBusConnection> or #f if error is set. Free with object:unref.

Procedure: dbus-connection:new-for-address address flags [observer] [cancellable] [callback]

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.

This constructor can only be used to initiate client-side connections - use dbus-connection:new if you need to act as the server. In particular, flags cannot contain the authentication-server, authentication-allow-anonymous or authentication-require-same-user flags.

When the operation is finished, callback will be invoked. You can then call dbus-connection:new-for-address-finish to get the result of the operation.

If observer is not #f it may be used to control the authentication process.

This is an asynchronous failable constructor. See dbus-connection:new-for-address-sync for the synchronous version.

address

Passed: a string.

a D-Bus address

flags

Passed: a <GDBusConnectionFlags>, or a list of its symbols, or one of them.

flags describing how to make the connection

observer

Passed, or left out: a <GDBusAuthObserver>, or #f.

a <GDBusAuthObserver> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback

Procedure: dbus-connection:new-for-address-finish res ⇒ %return

Finishes an operation started with dbus-connection:new-for-address.

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:new

%return

Returned: a <GDBusConnection>.

a <GDBusConnection> or #f if error is set. Free with object:unref.

Procedure: dbus-connection:new-for-address-sync address flags [observer] [cancellable] ⇒ %return

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.

This constructor can only be used to initiate client-side connections - use dbus-connection:new-sync if you need to act as the server. In particular, flags cannot contain the authentication-server, authentication-allow-anonymous or authentication-require-same-user flags.

This is a synchronous failable constructor. See dbus-connection:new-for-address for the asynchronous version.

If observer is not #f it may be used to control the authentication process.

address

Passed: a string.

a D-Bus address

flags

Passed: a <GDBusConnectionFlags>, or a list of its symbols, or one of them.

flags describing how to make the connection

observer

Passed, or left out: a <GDBusAuthObserver>, or #f.

a <GDBusAuthObserver> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a <GDBusConnection>.

a <GDBusConnection> or #f if error is set. Free with object:unref.

Procedure: dbus-connection:new-sync stream guid flags [observer] [cancellable] ⇒ %return

Synchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by stream.

If stream is a <GSocketConnection>, then the corresponding <GSocket> will be put into non-blocking mode.

The D-Bus connection will interact with stream from a worker thread. As a result, the caller should not interact with stream after this method has been called, except by calling object:unref on it.

If observer is not #f it may be used to control the authentication process.

This is a synchronous failable constructor. See dbus-connection:new for the asynchronous version.

stream

Passed: a <GIOStream>.

a <GIOStream>

guid

Passed: a string, or #f.

the GUID to use if authenticating as a server or #f

flags

Passed: a <GDBusConnectionFlags>, or a list of its symbols, or one of them.

flags describing how to make the connection

observer

Passed, or left out: a <GDBusAuthObserver>, or #f.

a <GDBusAuthObserver> or #f

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a <GDBusConnection>.

a <GDBusConnection> or #f if error is set. Free with object:unref.

Method: dbus-connection:register-object self object-path interface-info [method-call-closure] [get-property-closure] [set-property-closure] ⇒ %return
Method: register-object self object-path interface-info [method-call-closure] [get-property-closure] [set-property-closure] ⇒ %return

Registers callbacks for exported objects at object-path with the D-Bus interface that is described in interface-info.

Calls to functions in vtable (and user-data-free-func) will happen in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from.

Note that all <GVariant> values passed to functions in vtable will match the signature given in interface-info - if a remote caller passes incorrect values, the org.freedesktop.DBus.Error.InvalidArgs is returned to the remote caller.

Additionally, if the remote caller attempts to invoke methods or access properties not mentioned in interface-info the org.freedesktop.DBus.Error.UnknownMethod resp. org.freedesktop.DBus.Error.InvalidArgs errors are returned to the caller.

It is considered a programming error if the GDBusInterfaceGetPropertyFunc function in vtable returns a <GVariant> of incorrect type.

If an existing callback is already registered at object-path and interface-name, then error is set to exists.

GDBus automatically implements the standard D-Bus interfaces org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable and org.freedesktop.Peer, so you don’t have to implement those for the objects you export. You can implement org.freedesktop.DBus.Properties yourself, e.g. to handle getting and setting of properties asynchronously.

Note that the reference count on interface-info will be incremented by 1 (unless allocated statically, e.g. if the reference count is -1, see dbus-interface-info:ref) for as long as the object is exported. Also note that vtable will be copied.

See this [server][class@Gio.DBusConnection#an-example-d-bus-server] for an example of how to use this method.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

object-path

Passed: a string.

the object path to register at

interface-info

Passed: a <GDBusInterfaceInfo>.

introspection data for the interface

method-call-closure

Passed, or left out: a <GClosure>, or #f.

get-property-closure

Passed, or left out: a <GClosure>, or #f.

set-property-closure

Passed, or left out: a <GClosure>, or #f.

%return

Returned: an unsigned 32-bit integer.

0 if error is set, otherwise a registration id (never 0) that can be used with dbus-connection:unregister-object?

vtable

a GDBusInterfaceVTable to call into or #f

user-data

data to pass to functions in vtable

user-data-free-func

function to call when the object path is unregistered

See GDestroyNotify for how it is called.

Method: dbus-connection:register-object-with-closures2 self object-path interface-info [method-call-closure] [get-property-closure] [set-property-closure] ⇒ %return
Method: register-object-with-closures2 self object-path interface-info [method-call-closure] [get-property-closure] [set-property-closure] ⇒ %return

Version of dbus-connection:register-object using closures instead of a <GDBusInterfaceVTable> for easier binding in other languages.

In contrast to dbus-connection:register-object and Gio.DBusConnection.register_object_with_closures, the reference counting semantics of the function wrapped by method-call-closure are not the same as those of GDBusInterfaceMethodCallFunc. Ownership of a reference to the <GDBusMethodInvocation> is not transferred to the function. Bindings must ensure that they add a reference to the <GDBusMethodInvocation> before calling any g_dbus_method_invocation_return_*() methods on it. This should be automatic as a result of the introspection annotations on those methods.

self

Passed: a <GDBusConnection>.

A <GDBusConnection>.

object-path

Passed: a string.

The object path to register at.

interface-info

Passed: a <GDBusInterfaceInfo>.

Introspection data for the interface.

method-call-closure

Passed, or left out: a <GClosure>, or #f.

<GClosure> for handling incoming method calls.

get-property-closure

Passed, or left out: a <GClosure>, or #f.

<GClosure> for getting a property.

set-property-closure

Passed, or left out: a <GClosure>, or #f.

<GClosure> for setting a property.

%return

Returned: an unsigned 32-bit integer.

0 if error is set, otherwise a registration ID (never 0) that can be used with dbus-connection:unregister-object?.

Method: dbus-connection:remove-filter self filter-id
Method: remove-filter self filter-id

Removes a filter.

Note that since filters run in a different thread, there is a race condition where it is possible that the filter will be running even after calling dbus-connection:remove-filter, so you cannot just free data that the filter might be using. Instead, you should pass a GDestroyNotify to dbus-connection:add-filter, which will be called when it is guaranteed that the data is no longer needed.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

filter-id

Passed: an unsigned 32-bit integer.

an identifier obtained from dbus-connection:add-filter

Method: dbus-connection:send-message self message flags ⇒ %return out-serial
Method: send-message self message flags ⇒ %return out-serial

Asynchronously sends message to the peer represented by self.

Unless flags contain the preserve-serial flag, the serial number will be assigned by self and set on message via dbus-message:set-serial. If out-serial is not #f, then the serial number used will be written to this location prior to submitting the message to the underlying transport. While it has a volatile qualifier, this is a historical artifact and the argument passed to it should not be volatile.

If self is closed then the operation will fail with closed. If message is not well-formed, the operation fails with invalid-argument.

See this [server][class@Gio.DBusConnection#an-example-d-bus-server] and [client][class@Gio.DBusConnection#an-example-for-file-descriptor-passing] for an example of how to use this low-level API to send and receive UNIX file descriptors.

Note that message must be unlocked, unless flags contain the preserve-serial flag.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

message

Passed: a <GDBusMessage>.

a <GDBusMessage>

flags

Passed: a <GDBusSendMessageFlags>, or a list of its symbols, or one of them.

flags affecting how the message is sent

%return

Returned: a boolean.

#t if the message was well-formed and queued for transmission, #f if error is set

out-serial

Returned: an unsigned 32-bit integer.

return location for serial number assigned to message when sending it or #f

Method: dbus-connection:send-message-with-reply self message flags timeout-msec [cancellable] [callback] ⇒ out-serial
Method: send-message-with-reply self message flags timeout-msec [cancellable] [callback] ⇒ out-serial

Asynchronously sends message to the peer represented by self.

Unless flags contain the preserve-serial flag, the serial number will be assigned by self and set on message via dbus-message:set-serial. If out-serial is not #f, then the serial number used will be written to this location prior to submitting the message to the underlying transport. While it has a volatile qualifier, this is a historical artifact and the argument passed to it should not be volatile.

If self is closed then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If message is not well-formed, the operation fails with invalid-argument.

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-connection:send-message-with-reply-finish to get the result of the operation. See dbus-connection:send-message-with-reply-sync for the synchronous version.

Note that message must be unlocked, unless flags contain the preserve-serial flag.

See this [server][class@Gio.DBusConnection#an-example-d-bus-server] and [client][class@Gio.DBusConnection#an-example-for-file-descriptor-passing] for an example of how to use this low-level API to send and receive UNIX file descriptors.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

message

Passed: a <GDBusMessage>.

a <GDBusMessage>

flags

Passed: a <GDBusSendMessageFlags>, or a list of its symbols, or one of them.

flags affecting how the message is sent

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied or #f if you don’t care about the result

See GAsyncReadyCallback for how it is called.

out-serial

Returned: an unsigned 32-bit integer.

return location for serial number assigned to message when sending it or #f

user-data

Not passed: guile-gi supplies it.

The data to pass to callback

Method: dbus-connection:send-message-with-reply-finish self res ⇒ %return
Method: send-message-with-reply-finish self res ⇒ %return

Finishes an operation started with dbus-connection:send-message-with-reply.

Note that error is only set if a local in-process error occurred. That is to say that the returned <GDBusMessage> object may be of type error. Use dbus-message:to-gerror? to transcode this to a <GError>.

See this [server][class@Gio.DBusConnection#an-example-d-bus-server] and [client][class@Gio.DBusConnection#an-example-for-file-descriptor-passing] for an example of how to use this low-level API to send and receive UNIX file descriptors.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

res

Passed: a <GAsyncResult>.

a <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-connection:send-message-with-reply

%return

Returned: a <GDBusMessage>.

a locked <GDBusMessage> or #f if error is set

Method: dbus-connection:send-message-with-reply-sync self message flags timeout-msec [cancellable] ⇒ %return out-serial
Method: send-message-with-reply-sync self message flags timeout-msec [cancellable] ⇒ %return out-serial

Synchronously sends message to the peer represented by self and blocks the calling thread until a reply is received or the timeout is reached. See dbus-connection:send-message-with-reply for the asynchronous version of this method.

Unless flags contain the preserve-serial flag, the serial number will be assigned by self and set on message via dbus-message:set-serial. If out-serial is not #f, then the serial number used will be written to this location prior to submitting the message to the underlying transport. While it has a volatile qualifier, this is a historical artifact and the argument passed to it should not be volatile.

If self is closed then the operation will fail with closed. If cancellable is canceled, the operation will fail with cancelled. If message is not well-formed, the operation fails with invalid-argument.

Note that error is only set if a local in-process error occurred. That is to say that the returned <GDBusMessage> object may be of type error. Use dbus-message:to-gerror? to transcode this to a <GError>.

See this [server][class@Gio.DBusConnection#an-example-d-bus-server] and [client][class@Gio.DBusConnection#an-example-for-file-descriptor-passing] for an example of how to use this low-level API to send and receive UNIX file descriptors.

Note that message must be unlocked, unless flags contain the preserve-serial flag.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

message

Passed: a <GDBusMessage>.

a <GDBusMessage>

flags

Passed: a <GDBusSendMessageFlags>, or a list of its symbols, or one of them.

flags affecting how the message is sent.

timeout-msec

Passed: a 32-bit integer.

the timeout in milliseconds, -1 to use the default timeout or G_MAXINT for no timeout

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f

%return

Returned: a <GDBusMessage>.

a locked <GDBusMessage> that is the reply to message or #f if error is set

out-serial

Returned: an unsigned 32-bit integer.

return location for serial number assigned to message when sending it or #f

Method: dbus-connection:set-exit-on-close self exit-on-close
Method: set-exit-on-close self exit-on-close

Sets whether the process should be terminated when self is closed by the remote peer. See dbus-connection:exit-on-close for more details.

Note that this function should be used with care. Most modern UNIX desktops tie the notion of a user session with the session bus, and expect all of a user’s applications to quit when their bus connection goes away. If you are setting exit-on-close to #f for the shared session bus connection, you should make sure that your application exits when the user session ends.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

exit-on-close

Passed: a boolean.

whether the process should be terminated when self is closed by the remote peer

Method: dbus-connection:signal-subscribe self sender interface-name member object-path arg0 flags callback ⇒ %return
Method: signal-subscribe self sender interface-name member object-path arg0 flags callback ⇒ %return

Subscribes to signals on self and invokes callback whenever the signal is received. Note that callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from.

If self is not a message bus connection, sender must be #f.

If sender is a well-known name note that callback is invoked with the unique name for the owner of sender, not the well-known name as one would expect. This is because the message bus rewrites the name. As such, to avoid certain race conditions, users should be tracking the name owner of the well-known name and use that when processing the received signal.

If one of match-arg0-namespace or match-arg0-path are given, arg0 is interpreted as part of a namespace or path. The first argument of a signal is matched against that part as specified by D-Bus.

If user-data-free-func is non-#f, it will be called (in the thread-default main context of the thread you are calling this method from) at some point after user-data is no longer needed. (It is not guaranteed to be called synchronously when the signal is unsubscribed from, and may be called after self has been destroyed.)

As callback is potentially invoked in a different thread from where it’s emitted, it’s possible for this to happen after dbus-connection:signal-unsubscribe has been called in another thread. Due to this, user-data should have a strong reference which is freed with user-data-free-func, rather than pointing to data whose lifecycle is tied to the signal subscription. For example, if a <GObject> is used to store the subscription ID from dbus-connection:signal-subscribe, a strong reference to that <GObject> must be passed to user-data, and object:unref passed to user-data-free-func. You are responsible for breaking the resulting reference count cycle by explicitly unsubscribing from the signal when dropping the last external reference to the <GObject>. Alternatively, a weak reference may be used.

It is guaranteed that if you unsubscribe from a signal using dbus-connection:signal-unsubscribe from the same thread which made the corresponding dbus-connection:signal-subscribe call, callback will not be invoked after dbus-connection:signal-unsubscribe returns.

The returned subscription identifier is an opaque value which is guaranteed to never be zero.

This function can never fail.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

sender

Passed: a string, or #f.

sender name to match on (unique or well-known name) or #f to listen from all senders

interface-name

Passed: a string, or #f.

D-Bus interface name to match on or #f to match on all interfaces

member

Passed: a string, or #f.

D-Bus signal name to match on or #f to match on all signals

object-path

Passed: a string, or #f.

object path to match on or #f to match on all object paths

arg0

Passed: a string, or #f.

contents of first string argument to match on or #f to match on all kinds of arguments

flags

Passed: a <GDBusSignalFlags>, or a list of its symbols, or one of them.

<GDBusSignalFlags> describing how arg0 is used in subscribing to the signal

callback

Passed: a procedure.

callback to invoke when there is a signal matching the requested data

See GDBusSignalCallback for how it is called.

%return

Returned: an unsigned 32-bit integer.

a subscription identifier that can be used with dbus-connection:signal-unsubscribe

user-data

Not passed: guile-gi supplies it.

user data to pass to callback

user-data-free-func

Not passed: guile-gi supplies it.

function to free user-data with when subscription is removed or #f

See GDestroyNotify for how it is called.

Method: dbus-connection:signal-unsubscribe self subscription-id
Method: signal-unsubscribe self subscription-id

Unsubscribes from signals.

Note that there may still be D-Bus traffic to process (relating to this signal subscription) in the current thread-default <GMainContext> after this function has returned. You should continue to iterate the <GMainContext> until the GDestroyNotify function passed to dbus-connection:signal-subscribe is called, in order to avoid memory leaks through callbacks queued on the <GMainContext> after it’s stopped being iterated. Alternatively, any idle source with a priority lower than G_PRIORITY_DEFAULT that was scheduled after unsubscription, also indicates that all resources of this subscription are released.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

subscription-id

Passed: an unsigned 32-bit integer.

a subscription id obtained from dbus-connection:signal-subscribe

Method: dbus-connection:start-message-processing self
Method: start-message-processing self

If self was created with delay-message-processing, this method starts processing messages. Does nothing on if self wasn’t created with this flag or if the method has already been called.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

Method: dbus-connection:unexport-action-group self export-id
Method: unexport-action-group self export-id

Reverses the effect of a previous call to dbus-connection:export-action-group.

It is an error to call this function with an ID that wasn’t returned from dbus-connection:export-action-group or to call it with the same ID more than once.

self

Passed: a <GDBusConnection>.

the D-Bus connection

export-id

Passed: an unsigned 32-bit integer.

the ID from dbus-connection:export-action-group

Method: dbus-connection:unexport-menu-model self export-id
Method: unexport-menu-model self export-id

Reverses the effect of a previous call to dbus-connection:export-menu-model.

It is an error to call this function with an ID that wasn’t returned from dbus-connection:export-menu-model or to call it with the same ID more than once.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

export-id

Passed: an unsigned 32-bit integer.

the ID from dbus-connection:export-menu-model

Method: dbus-connection:unregister-object? self registration-id ⇒ %return
Method: unregister-object? self registration-id ⇒ %return

Unregisters an object.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

registration-id

Passed: an unsigned 32-bit integer.

a registration id obtained from dbus-connection:register-object

%return

Returned: a boolean.

#t if the object was unregistered, #f otherwise

Method: dbus-connection:unregister-subtree? self registration-id ⇒ %return
Method: unregister-subtree? self registration-id ⇒ %return

Unregisters a subtree.

self

Passed: a <GDBusConnection>.

a <GDBusConnection>

registration-id

Passed: an unsigned 32-bit integer.

a subtree registration id obtained from g_dbus_connection_register_subtree()

%return

Returned: a boolean.

#t if the subtree was unregistered, #f otherwise

Signals

Signal: dbus-connection:closed

Connect a handler with (connect object dbus-connection:closed handler). It is called as (handler self remote-peer-vanished error).

Emitted when the connection is closed.

The cause of this event can be

  • If the remote peer closes the connection. In this case remote-peer-vanished is set to #t and error is set.
  • If the remote peer sends invalid or malformed data. In this case remote-peer-vanished is set to #f and error is set.

Upon receiving this signal, you should give up your reference to connection. You are guaranteed that this signal is emitted only once.

self

Passed: a <GDBusConnection>.

remote-peer-vanished

Passed: a boolean.

#t if connection is closed because the remote peer closed its end of the connection

error

Passed: a <GError>, or #f.

a <GError> with more details about the event or #f