-
public uint add_filter (owned DBusMessageFilterFunction filter_function)
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.
-
public async Variant call (string bus_name, string object_path, string interface_name, string method_name, Variant? parameters, VariantType? reply_type, DBusCallFlags flags, int timeout_msec, Cancellable? cancellable = null) throws Error
Asynchronously invokes the method_name method on the interface_name D-Bus
interface on the remote object at object_path owned by bus_name.
-
public Variant call_sync (string bus_name, string object_path, string interface_name, string method_name, Variant? parameters, VariantType? reply_type, DBusCallFlags flags, int timeout_msec, Cancellable? cancellable = null) throws Error
Synchronously invokes the method_name method on the interface_name D-Bus
interface on the remote object at object_path owned by bus_name.
-
public async Variant call_with_unix_fd_list (string bus_name, string object_path, string interface_name, string method_name, Variant? parameters, VariantType? reply_type, DBusCallFlags flags, int timeout_msec, UnixFDList? fd_list, Cancellable? cancellable = null, out UnixFDList? out_fd_list) throws Error
-
public Variant call_with_unix_fd_list_sync (string bus_name, string object_path, string interface_name, string method_name, Variant? parameters, VariantType? reply_type, DBusCallFlags flags, int timeout_msec, UnixFDList? fd_list, out UnixFDList? out_fd_list, Cancellable? cancellable = null) throws Error
-
public async bool close (Cancellable? cancellable = null) throws Error
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
exit_on_close).
-
public bool close_sync (Cancellable? cancellable = null) throws Error
Synchronously closees connection. The calling thread is blocked until this is done. See
close for the asynchronous version of this method and more details about
what it does.
-
public bool emit_signal (string? destination_bus_name, string object_path, string interface_name, string signal_name, Variant parameters) throws Error
Emits a signal.
-
public async bool flush (Cancellable? cancellable = null) throws Error
Asynchronously flushes connection, that is, writes all queued outgoing message to the
transport and then flushes the transport (using flush_async).
This is useful in programs that wants 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.
-
public bool flush_sync (Cancellable? cancellable = null) throws Error
Synchronously flushes connection. The calling thread is blocked until this is done. See
flush for the asynchronous version of this method and more details about
what it does.
-
public DBusCapabilityFlags get_capabilities ()
Gets the capabilities negotiated with the remote peer
-
public bool get_exit_on_close ()
Gets whether the process is terminated when connection is closed by the remote peer. See
exit_on_close for more details.
-
public unowned string get_guid ()
The GUID of the peer performing the role of server when authenticating. See
guid for more details.
-
public weak Credentials get_peer_credentials ()
Gets the credentials of the authenticated peer. This will always return null unless
connection acted as a server (e.g.
AUTHENTICATION_SERVER was passed) when set up and the client passed credentials as part of the authentication process.
-
public async T get_proxy<T> (string? name, string object_path, DBusProxyFlags flags = 0, Cancellable? cancellable = null) throws IOError
-
public T get_proxy_sync<T> (string? name, string object_path, DBusProxyFlags flags = 0, Cancellable? cancellable = null) throws IOError
-
public weak IOStream get_stream ()
Gets the underlying stream used for IO.
-
public unowned string get_unique_name ()
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.
-
public bool is_closed ()
Gets whether connection is closed.
-
public uint register_object<T> (string object_path, T object) throws IOError
Registers callbacks for exported objects at object_path with the D-Bus interface that is
described in interface_info.
-
public uint register_subtree (string object_path, DBusSubtreeVTable vtable, DBusSubtreeFlags flags, DestroyNotify user_data_free_func) throws Error
-
public void remove_filter (uint filter_id)
Removes a filter.
-
public bool send_message (DBusMessage message, DBusSendMessageFlags flags, out uint32 out_serial) throws Error
Asynchronously sends message to the peer represented by connection.
-
public async DBusMessage send_message_with_reply (DBusMessage message, DBusSendMessageFlags flags, int timeout_msec, out uint32 out_serial, Cancellable? cancellable = null) throws Error
Asynchronously sends message to the peer represented by connection.
-
public DBusMessage send_message_with_reply_sync (DBusMessage message, DBusSendMessageFlags flags, int timeout_msec, out uint32 out_serial, Cancellable? cancellable = null) throws Error
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
send_message_with_reply for the asynchronous version of
this method.
-
public void set_exit_on_close (bool exit_on_close)
Sets whether the process should be terminated when connection is closed by the remote peer.
See exit_on_close for more details.
-
public uint signal_subscribe (string? sender, string? interface_name, string? member, string? object_path, string? arg0, DBusSignalFlags flags, owned DBusSignalCallback callback)
Subscribes to signals on connection and invokes callback with a whenever the
signal is received. Note that callback will be invoked in the thread-default
main
loop of the thread you are calling this method from.
-
public void signal_unsubscribe (uint subscription_id)
Unsubscribes from signals.
-
public void start_message_processing ()
If connection was created with
DELAY_MESSAGE_PROCESSING, this method starts
processing messages. Does nothing on if connection wasn't created with this flag or if the method has already been
called.
-
public bool unregister_object (uint registration_id)
Unregisters an object.
-
public bool unregister_subtree (uint registration_id)
Unregisters a subtree.