DBusConnection.close

void close(gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)

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).

Once the connection is closed, operations such as sending a message will return with the error gio.types.IOErrorEnum.Closed. Closing a connection will not automatically flush the connection so queued messages may be lost. Use gio.dbus_connection.DBusConnection.flush if you need such guarantees.

If connection is already closed, this method fails with gio.types.IOErrorEnum.Closed.

When connection has been closed, the #GDBusConnection::closed signal is emitted in the thread-default main context of the thread that connection was constructed in.

This is an asynchronous method. When the operation is finished, callback will be invoked in the thread-default main context of the thread you are calling this method from. You can then call gio.dbus_connection.DBusConnection.closeFinish to get the result of the operation. See gio.dbus_connection.DBusConnection.closeSync for the synchronous version.

Parameters

cancellablea #GCancellable or null
callbacka #GAsyncReadyCallback to call when the request is satisfied or null if you don't care about the result