Using D-BUS with GLib and no dbus-daemon

John (J5) Palmieri johnp at
Wed Feb 15 07:46:12 PST 2006

A little further investigation reveals dbus_server_setup_with_g_main

It is used in conjunction with a DBusServer which will allow you to
handle connection like you are a bus.

Looks pretty straight forward.  You create a server and have it listen
on a socket and have the client open up a connection to that socket.
How the client finds out about the socket (whether it is well known or
you use the session bus to pass that information) is up to you.  I think
after that everything else is the same as if you were talking to one of
the standard busses. 

On Wed, 2006-02-15 at 10:32 -0500, John (J5) Palmieri wrote:
> I remember Colin telling me he had added support to the glib bindings to
> get a server connection (i.e. act as a standalone server).  I'm not
> totally sure how to do that and I am pretty sure there is no example
> code.  Not sure if that helps but perhaps it can direct you to a
> solution.
> On Wed, 2006-02-15 at 07:16 -0800, James Kent wrote:
> > First, an introduction.  My name is Jim Kent.  I work for PalmSource and have been investigating various IPC technologies to use as part of an application framework we're developing.
> > 
> > One thing I've been investigating is using D-BUS with GLib for peer-to-peer communication between processes (i.e. with no dbus-daemon).
> > 
> > I've got code working that sets up the server and client connections using the D-BUS low-level public API calls.  In other words, each process has a DBusConnection*.  The problem I'm having is that in order to call dbus_g_proxy_new_for_peer, I need a DBusGConnection*, not a DBusConnection*.  I've poked around in the source and found the macro DBUS_CONNECTION_TO_G_CONNECTION that does this, so I can make this work, but the macro is not exposed in the installed headers, so its obviously not expected to be used to do this.
> > 
> > Is there some API I've missed that allows me to get a DBusGConnection* for my peer to peer client and server?
> > 
> > If someone has the D-BUS/GLib statemachine sample code modified to work with direct connections between the client and server, that would be ideal.  If not, any help is appreciated.
> > 
> > Thanks
> > Jim Kent
> > james.kent at
> > _______________________________________________
> > dbus mailing list
> > dbus at
> >

John (J5) Palmieri <johnp at>

More information about the dbus mailing list