how to get the DBusConnection for dbus_connection_dispatch from a DBusWatch of a DBusServer ?

Alexander Neundorf neundorf at eit.uni-kl.de
Thu Jun 18 05:58:37 PDT 2009


On Thursday 18 June 2009 14:21:08 Havoc Pennington wrote:
> For the server watches and timeouts, you don't dispatch, just
> dbus_watch_handle()

So if poll() tells me that something happened on the fd for the server watch, 
then I call 
dbus_watch_handle(watch, flags);
What is flags then ?
The documentation says its similar to the POLLIN/POLLOUT etc. flags. So can I 
just use the .revents field from struct pollfd ?

And what will the handler do then ?

(I did that now and I don't see any effect)

> This is true of the connection watches and timeouts also really; you
> don't dispatch when the watch is ready, you dispatch when dispatch
> status changes. (set_dispatch_status_function or whatever)

I don't understand what you mean.
Is it correct to call poll() on all the file descriptors ?
What should I do then ?
If I don't call dbus_connection_dispatch(), who will call this status 
callback ?
Can you please elaborate a bit ?

(I tried to do that but the callback is not called)

Thanks
Alex



More information about the dbus mailing list