DBusConnection.sendMessage

Asynchronously sends message to the peer represented by connection. Unless flags contain the G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number will be assigned by connection and set on message via g_dbus_message_set_serial(). If out_serial is not NULL, then the serial number used will be written to this location prior to submitting the message to the underlying transport. If connection is closed then the operation will fail with G_IO_ERROR_CLOSED. If message is not well-formed, the operation fails with G_IO_ERROR_INVALID_ARGUMENT. See Example 6, “D-Bus server example” and Example 8, “D-Bus UNIX File Descriptor example” 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 G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. Since 2.26

class DBusConnection
int
sendMessage

Parameters

message DBusMessage

A GDBusMessage

flags GDBusSendMessageFlags

Flags affecting how the message is sent.

outSerial uint

Return location for serial number assigned to message when sending it or NULL. out[allow-none]

Return Value

Type: int

TRUE if the message was well-formed and queued for transmission, FALSE if error is set.

Throws

GException on failure.

Meta