--nextPart1182226.lE5YCEE6N4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Xavier Claessens wrote: >I'm writing a simple dbus service using GLIB interface. My problem is >that I have to keep some information about each client. For example how >can I emit a signal on the object only for one specific client, or with >different data for each client ? You can't. A signal is emitted to whoever wants to listen to it. If you want to talk to a specific destination, you should use a method=20 call. >Another problem I have is how to know when a client connect/disconnect ? Use the NameOwnerChanged signal from the org.freedesktop.DBus interface=20 (object /, service org.freedesktop.DBus). >Because I keep some data in a hash table, I want to know when a client >disconnect to delete corresponding data. > >How can I make that properly with dbus ?!? The NameOwnerChanged is emitted for the unique-connection-name when the=20 client goes away. The new_owner string (the third string) will be empty. > - I register a main object with a connect method which returns an ID to >the client. The connect method also create and register a new object >just for this client which is stored in a list. The client, using the ID >can get the remote object and use it. Signals and method on this object >will have special effects depending on what the client does with it and >not interfering with what other clients does with other objects. > - The main object has also a disconnect method which takes the ID in >param and remove all data related to this client. > >Is that the good way ? Does someone knows if other projects does the >same thing, like that I can see how they do... Yes, that makes sense. In fact, this is what I recommend as a proper OOP=20 approach. =2D-=20 Thiago Jos=E9 Macieira - thiago.macieira AT trolltech.com Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway --nextPart1182226.lE5YCEE6N4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEnowNM/XwBW70U1gRAjyYAJsHDH6+TO9GZkCWvXWADSDXTxXfdwCgulml J4nC5ZYJ8ScFfyQwHsKHGXY= =ps4y -----END PGP SIGNATURE----- --nextPart1182226.lE5YCEE6N4--