glib bindings vs. libdus

Colin Walters walters at verbum.org
Tue Jul 26 01:26:48 EST 2005


On Mon, 2005-07-25 at 16:17 +0200, Thomas Renninger wrote:

>     - I need file descriptors for the select loop to listen on.
>     - I considered changing the select loop into a glib mainloop,
>       however this seemed to me rather complicated.

The GLib mainloop is really nice; you get a lot of infrastructure for
free.

>     - As this is a daemon I do not want to link against a bunch of
>       (heavy weight - e.g. like QT) extra libraries.

As John said, glib is not like Qt; basically Qt is the equivalent of
glib and GTK+ together.  I think in Qt4 they were going to separate out
the non-GUI runtime bits.

> After a lot of work I got it running (beside some little edges -
> e.g. I only use one fd/watch at the moment, I think for multiple
> connections I need handling of multiple watches/fds? ...)

If you use DBusServer (which isn't wrapped in GLib yet), all you need to
do is call dbus_server_setup_with_g_main.

>      - Initialising DBus stuff and pass over mainloop.
>      - In mainloop I set up my file descriptors I like to watch and
>        wait on a select.
>      - DBus queries are somehow handled in the background (threaded, I think not?)
>        and I get invoked through callbacks while my mainloop still waits for fds to get readable/writable
>        on the select.

All this stuff is handled by DBusServer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050725/06b5fc8e/attachment.pgp


More information about the dbus mailing list