DBus Over multiple machines

Jason Keirstead jason.keirstead@Q1Labs.com
Fri, 12 Dec 2003 09:42:33 -0400


Hello all. I am tryuing to use DBUS for an internal project, but am running 
into difficulties regarding its ability to be used over multiple machines via 
TCP.

As I understand it, while the API to open a connection to the session bus is:

	dbus_bus_get( DBUS_BUS_SESSION, &busError );

... the calls needed to connect to a bus on another machine via TCP are:

	DBusConnection *busConnection = dbus_connection_open( address, &busError )
	dbus_bus_register( busConnection , &busError )

( Error handling omitted for simplicity )

After the dbus_bus_register, my understanding is that the connection is 
complete. However, when I try this with an address of the form:

	"tcp:host=dbushost,port=1337"

... I get various errors. At first, I was getting disconnecte dimmediatly 
since I could not figure out how to get authentication to work. After totally 
disabling authentication on the server, I am getting the error "Disconnected 
prior to receiving a reply"

Here are my questions:

1. How do I authenticate myself properly when conecting to a DBUS on another 
machine via TCP/IP?

2. Is what I have above all that is needed to do this? If not, what am I 
missing?

And a suggestion:

I think DBUS would be much more powerful if a message routing mechanism was 
built in the the dbus-daemon. For example, say your network had two 
application servers, com.FooBarCo.Server1 and com.FooBarCo.Server2. The DBUS 
daemon config files could have an entry that specified that messages destined 
for certain applications could get routed to different machines. For example:

<route namespace="com.FooBarCo.FooApplication" destination="Server1" />
<route namespace="com.FooBarCo.FooApplication" destination="Server2" />

.. or somesuch, where Server1 is a hostname or IP. Then, if you send a message 
to FooApplication, this bus relays the message to the other machine's bus, 
which then passes it on to FooApplication If the first relay bus does not 
have FooApplication registered, an error is sent back and the bus tries the 
next relay in the list.

The sender service on the message would be set in such a way that replys would 
be sent back to the original sender.

Also via this mechanism, by having different orderings of relays in different 
servers, you have a built in form of load-balencing.

-- 
Jason Keirstead 
Software Developer
Q1Labs Inc.

506.462.9117 ext. 111 - Office
506.260.0787 - Mobile
1.877.471.5227

jason.keirstead@fredericton.q1labs.com | www.q1labs.com

Do you know what is happening on your network RIGHT NOW?

QVISION - Network Security Intelligence