[patch] gobject sender and pid
hp at redhat.com
Sun Mar 12 22:20:52 PST 2006
On Mon, 2006-03-13 at 00:03 -0500, David Zeuthen wrote:
> Attached is a patch that enables the method handler on a GObject to
> figure out who the sender is. I'm not sure this is the best way to do
> this but I thought I'd send the patch anyway. I'd like to see this fixed
> as I really need to know the sender. Without this patch the glib
> bindings are not very useful for system bus stuff since you more often
> than not needs to know who you are talking to.
Suggest there should at least be accessors, rather than encouraging
direct use of a magic object data name. But it's also an inherently
unthreadsafe approach... maybe thread-local data? I swear we had a list
thread a while back about how to do this though, with some conclusion.
> I've also added dbus_bus_get_unix_process_id() as a convenience
> function.. note that the bus have exported this method for ages now;
> this is only convenience.
Suggest naming it to exactly match the dbus method, though
get_connection_unix_process_id() is long... dbus-bus.h is unfortunately
very ad hoc, but ideally let's not make it worse with new methods.
I'm kind of tempted to say let's kill dbus-bus.h in favor of having
people generate it for their bindings. Or rather, I'm almost 100% sure
dbus-bus.h should only have dbus_bus_get() and friends, no convenience
methods. But it's not as simple as just deleting them since the new
binding APIs would have to be added also.
More information about the dbus