DBUS service using glib: question

Ross Burton ross at burtonini.com
Wed Jul 19 02:06:34 PDT 2006


On Wed, 2006-07-19 at 10:58 +0200, Xavier Claessens wrote:
>  - Clients has a name returned by dbus_g_method_get_sender. But how
> clients can get his name ? My idea is to register a new object for each
> client with path "/org/blah/<client's name>". But the client has to know
> his name to know the path. Is it possible ? Or should I register an
> object with a method like "GetObjectPath" which returns the path of the
> object registered for the client calling this method ?

dbus_get_unique_name() will return the processes name on the bus.  It
might be better to return the object path of the object you create when
clients register with the server, this way you can change the naming
scheme in only one place.

>  - Another question: Is it possible to have methods with valist in args
> or with the printf syntax. for example func(char *format, ...); ?

It's possible with the low-level APIs (as the client can add arguments
as required, and the server could iterate over the message directly),
but the glib bindings don't support it.  Pass an array instead?

Ross
-- 
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





More information about the dbus mailing list