Tracking DBusWatches
tsuraan
tsuraan at gmail.com
Mon Feb 5 13:51:58 PST 2007
> The two watches probably have different flags (one is supposed to be
> watched for reading, one for writing). So they are in fact different and
> you need to add both of them, with different conditions watched for
> depending on the flags.
That is indeed the case. Are read and write mutually exclusive, or do I
need to look out for watches that need to be added to both read and write
mappings (I'm planning on keeping a mapping from fd -> watch).
Looking at the main loop used by dbus-daemon itself, it appears to rely
> on it being OK to pass the same fd to poll() twice with different flags.
> I don't know if this is really OK; it's possible there's a bug here in
> dbus-daemon.
>
> One of the watches is for writing and will only be enabled when there
> are outgoing messages to write. The other message is for reading and
> will more or less always be enabled.
Ok, that makes sense.
The free function passed to set_watch_functions() is to free the "void
> *data" you supplied when the DBusConnection is destroyed. You need not
> supply a free function if you did not supply any data that needs freeing.
I must have missed that :) I'm still trying to get the overall view of how
the system works, so I'm probably still missing plenty of important things.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20070205/f8c54321/attachment.html
More information about the dbus
mailing list