Multiple connections to the same bus from the same client
trow at ximian.com
Tue Sep 28 08:37:40 UTC 2004
On Mon, 2004-09-27 at 23:28 +0100, Bastien Nocera wrote:
> On Tue, 2004-09-28 at 03:46 -0500, Jon Trowbridge wrote:
> > Is there any scenario in which it would make sense for a single instance
> > of a application to open multiple simultaneous connections to a bus?
> Make sense, I don't know, but a GNOME application that uses d-bus for
> its IPC, has a BaconCdSelection widget (a simple CD device selection
> widget that uses HAL) and uses the GnomeVFSVolume API (which uses HAL as
> well) would have 2 connection to the d-bus via HAL and one direct one
> (possibly not to the system bus though).
This was exactly the sort of case I was worried about when I originally
posted --- apps ending up with lots of connections to one message bus
because of libraries.
Fortunately, someone else already had that worry. I just looked at the
source code, and dbus_bus_get does the right thing: it will return the
previously-opened connection if you try to connect to the same bus
More information about the dbus