[D-BUS] How handle D-BUS messages without GLib main loop?

Havoc Pennington hp at redhat.com
Tue Jun 14 09:55:25 PDT 2005


On Mon, 2005-06-13 at 17:24 -0300, Claudio Takahasi wrote:
> The function dbus_connection_setup_with_g_main sets the watch 
> and timeout functions of a DBusConnection to integrate the 
> connection with the GLib main loop.
> 
> However, I need remove glib dependency. I developed
> a workaround writing my own main loop and handling
> D-Bus messages. The skeleton is below.
> 
> Is there another way to implement it?

There's a similar hand-rolled loop in dbus-mainloop.c if you want to
look at that, though it isn't that exemplary.

Another option is to either just use blocking IO, or use threads.

Havoc




More information about the dbus mailing list