I need to write an application in C for asynchronous sending and reading messages on the dbus message queue. I've read that for doing that I should use the `DBusWatch` and `DBusTimeout` objects that the connection provides, but I cannot find an example of how to use these anywhere... 

For the moment i use [`dbus_connection_read_write_dispatch`](http://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#ga580d8766c23fe5f49418bc7d87b67dc6) in order to do that, but I've read that it is not recommended for asynchronous operations, so I'll have to switch to creating my own `main loop` and using it...

The closest answer to my question was this one:

<http://lists.freedesktop.org/archives/dbus/2007-September/008555.html> , 

suggesting to look through the dbus-gmain.c file, which I did, but all I found there was a call of the [`dbus_connection_set_watch_functions`](http://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#gaebf031eb444b4f847606aa27daa3d8e6) and [`dbus_connection_set_timeout_functions`](http://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#gab3cbc68eec427e9ce1783b25d44fe93c), with other functions as parameters - should I overwrite those functions? Should I use them as they are? 

I simply cannot figure out how to use these in order to read and write something to the dbus message queue...

Any idea would be more than welcome...