DBus in the kernel?
Kimmo Hämäläinen
kimmo.hamalainen at nokia.com
Fri Jan 8 01:32:28 PST 2010
On Thu, 2010-01-07 at 15:58 +0100, ext Thiago Macieira wrote:
...
> > srsly? theres no way a byte array an be marshalled 'in place' ?
> >
> > if so thats a pretty big FAIL. I cant see anything in the wire protocol
> > that prevents in place marshalling of byte arrays though.
>
> The protocol allows for that, but the API doesn't.
>
> It requires knowing that the byte array remains valid throughout the lifetime
> of the DBusMessage object.
>
> If you do:
> DBusMessage *msg = dbus_message_new_something ();
> dbus_message_fictitious_append_bytearray_nocopy (msg, array, len);
> dbus_connection_send (conn, msg);
> dbus_message_unref (msg);
>
> The message may still not be sent by the time dbus_connection_send returns (if
> the socket cannot be written to, for example). The event loop will be
> responsible for sending it later, when the socket can accept data.
>
> We don't know how long later that will be. And there's no way of notifying
> that the data has been sent, so can be erased.
If there is a reply to the message (and often there is reply/error), you
would know when it's not needed anymore. You could use PendingCall or a
filter to receive the reply.
-Kimmo
More information about the dbus
mailing list