Havoc Pennington hp at redhat.com
Thu Jun 1 07:58:24 PDT 2006

WANG Gang RD-ILAB-PEK wrote:
> hi,
>   can anyone tell me under what circumstances should I use
> dbus_connection_flush() ?

When you send a message, it's queued up but not necessarily written out 
to a socket, because dbus_connection_send() does not block.

If you return to the main loop and have dbus hooked into the main loop, 
the message queue should get written out as the socket is writable.

But if you want to block on the dbus socket only (as opposed to the 
whole main loop) until the message queue is 100% written out, you can 
call flush()

You would not normally flush() in a program using a main loop.


More information about the dbus mailing list