Async DBusMessage reads using the C API

Matthew Johnson dbus at
Tue Nov 1 12:25:31 PST 2005

On Tue, 1 Nov 2005, Havoc Pennington wrote:

> My suggestion is dbus_connection_read_write() which would be more
> flexible; you could then mix that with dbus_connection_pop_message() to
> do what you want, or dbus_connection_dispatch(). read_write() should
> probably block by default, though I guess having an argument for whether
> to block is possible.

Yeah, I was wondering whether to do that. You definitely want it to be
non-blocking though. There's a lot of applications where the thread Must
Not Block or bad things will happen (I'm thinking of two applications
I'm involved with atm, one of which is having problems with a library 
which doesn't cope with non-blocking IO).

> I wonder if we should have dbus_connection_pop_message() given the huge
> caveats in its API docs. It's sort of a dbus_shoot_me_in_foot()
> function. I guess we use it in a lot of the test code though ;-)

Well, using it like I am its fine, if you are sharing the dbus
connection with other things or mixing it with the glib bindings then

Matthew Johnson

More information about the dbus mailing list