dbus_connection_read_write_dispatch problem

Eugene Gorodinsky e.gorodinsky at gmail.com
Sat Aug 1 09:36:18 PDT 2009


The documentation says the function will block for the amount of
milliseconds passed to it as a second argument. Thus the test program
below should exit after about 5 seconds. That isn't happening. Am I
reading the documentation wrong?


#include <dbus/dbus.h>
#include <time.h>

int main()
{
    DBusConnection *connection;
    connection = dbus_bus_get(DBUS_BUS_SESSION,NULL);
    if (connection)
    {
        while (clock()/CLOCKS_PER_SEC<5)
        {
            dbus_connection_read_write_dispatch(connection, 50);
        }
    }
    return 0;
}


More information about the dbus mailing list