Re: GVariant support for Unix fds (Was Re: GDBus/GVariant plans for next GLib release)



On Mon, 2009-11-09 at 11:29 -0500, Ryan Lortie wrote:
> > Hmm, I don't like this approach. It means you'd have to pass this
> > GDBusFDSet object around in code you use to build/parse the GVariant. In
> > particular, your proposed GTypeSerializer would need support for it.
> > That's problematic because that one lives in libgobject, not libgio
> > (where GDBusFDSet would live).
> 
> I disagree.  I'd actually like to keep support for file descriptors out
> of the type serialiser entirely.  It's just a little bit "too magic" for
> my tastes.
> 
> A file descriptor is not normally considered to be a serialisable
> object.

It's not so different from, say, object paths (many people pass
transient object paths around).

[snip]

> I appreciate that doing the GDBusFdSet thing results in some
> uglification of the GDBus API (ie: addition of a new type and some new
> functions call variants in some places) but I think this is the
> reasonable thing to do.  fd-passing is *very* DBus-specific.  Please
> remember that GVariant and GTypeSerialiser are general purpose datatypes
> with many potential uses (eg: dconf, GSettings, mmap files, etc) and
> that for these other uses, serialising a file descriptor makes no sense
> at all.

I guess we can do the GDBusFdSet thing and bloat the GDBus API..
though... now every method dealing with a GVariant needs to take both a
GVariant AND also a GDBusFdSet. That's not really cool.

Should probably define an abstract GDBusHandleSet interface and then
have a concrete GDBusUnixFdSet class (and possibly a GDBusWin32HandleSet
too) implement it.

     David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]