Re: GDBus API/usage questions



Hey Travis,

I've been on vacation the past two weeks so my reply is a bit delayed.

On Wed, 2009-11-25 at 11:57 -0800, Travis Reitter wrote:
> Hi David,
> 
> I'm porting e-d-s's libebook from dbus-glib to gdbus and I've run into
> a couple confusing bits of GDBus:
> 
> * g_dbus_connection_bus_get() always seems to end in this failure:
> 
> GLib-DBus-Standalone:ERROR:gdbusprivate.c:259:connection_setup_add_watch:
> assertion failed: (dbus_watch_get_data (watch) == NULL)
> 
> Is this intentional? Should there just be some simple tracking to
> avoid running the setup on the same connection twice? Is it a case of
> the connection being set up upon the original _get() and again when
> creating a proxy for it?

Nope, bus_get() just be able to be called multiple times - I think
there's even a test-case for it.

> * I've worked around the above problem in my own code by using
> g_dbus_connection_bus_get_private(), but I just bumped into this same
> problem within gdbusproxywatching, just doing something similar to
> example-watch-proxy.c
> 
> * How is service activation supposed to work with GDBus? I don't see
> any way to get the DBusConnection for a given GDBusProxy or
> GDBusConnection -- should I just use dbus_bus_get(), or am I missing
> some convenience API?

There's some work remaining to be done here - see

http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00075.html

> * I seem to have a race between a service handling daemon exiting
> (which it does a few seconds after all clients disconnect) and a
> client connecting to it (and then failing when it gets a timeout
> calling one of its methods). I assume I need to watch for the proxy
> disappearing (as above), but, like I said, I can't seem to get that to
> work

I need to look into that (and add tests for it) - service activation
isn't really tested yet. And APIs like g_bus_own_name() probably needs
to  be changed as it is inherently racey (when you register objects in
the name_owned handler it is usually too late).

> * When I create a proxy for a D-Bus object that has neither signals
> nor properties, the proxy creation fails unless I pass
> (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
> G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS). Is that expected?

No, sounds like a bug. We should have tests for this.

> Here's my branch that works (except for that race condition):
> 
> http://git.gnome.org/cgit/evolution-data-server/log/?h=treitter-client-gdbus
> 
> Here's the branch where I'm trying to watch the proxy (and obviously
> doesn't work; it's a direct descendant of the branch above, though I
> accidentally mangled the refs, so it doesn't appear to be):
> 
> http://git.gnome.org/cgit/evolution-data-server/log/?h=treitter-client-gdbus-watch-proxy
> 
> Am I doing anything obviously wrong in the -watch-proxy branch?

I'll look at your branches - hopefully soon depending on what else I
need to work on in December. Thanks a lot for trying this out!

Cheers,
David




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