[Patch] Moving FD passing into the header
Thiago Macieira
thiago at kde.org
Thu Jun 17 23:23:42 PDT 2010
Em Sexta-feira 18. Junho 2010, às 06.08.52, Marcel Holtmann escreveu:
> > > QDBusPendingReply<ReturnType> reply = interface.asyncCall("something");
> >
> > You can bind it as reply.wait(); reply.getUnixFileDescriptor(0); right?
>
> so within BlueZ, obexd, oFono and PulseAudio we were planning to
> actually make a lot of use of the fd passing. So I would say it is very
> much common. And why not?
>
> As I said before, I really like having the file descriptors as part of
> the introspection data. Treating it as side channel or out-of-band data
> seems pretty much wrong to me. It leads to hacks and other weird per
> application agreements. While once it is part of the actual API, it can
> be properly specified with common D-Bus introspection for methods.
Here's another reason:
what happens if the caller doesn't remember to send the file descriptor in a
call?
With the signature: the call won't be delivered, resulting in probably an
UnknownMethod error.
Without the signature: the call will be delivered, and it's up to the callee
to find out that the file descriptors were not passed, then send its own return
error.
Also note that removing the file descriptor from the signature makes it
possible to call a file-descriptor-receiving method from a transport that
doesn't support passing file descriptors.
Finally, with the addition of Maybe types, we are changing the type system
anyway.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100618/c1fbde46/attachment.pgp>
More information about the dbus
mailing list