how to get the DBusConnection for dbus_connection_dispatch from a DBusWatch of a DBusServer ?
Havoc Pennington
havoc.pennington at gmail.com
Thu Jun 18 07:54:24 PDT 2009
Hi,
On Thu, Jun 18, 2009 at 10:25 AM, Alexander
Neundorf<neundorf at eit.uni-kl.de> wrote:
> When a client tries to connect, I get two AddWatch() callbacks.
> That's ok, but I didn't find any documentation what they are good for (I would
> have expected one instead of two). I wait for the enabled ones using poll().
well, it doesn't really matter; the idea is that it's opaque to the
app what a watch is used for. I don't remember offhand why there are
two. Feel free to read the source ;-)
> This seems to toggle the enabled/disabled state of the two watches.
> Does the enabled/disabled state have any other purpose than to tell me whether
> I should poll on this file descriptor ?
> I mean, does it also do something internally ?
No, it's just whether to poll. For example, if there are no messages
to send in the outgoing queue, the poll for socket writability will be
disabled.
> So, I have now these two watches, one is on, one is off, but I don't get
> another event, although the client tries to send a message.
Maybe the write watch is enabled and when you handle it, dbus will
write out the message.
> I also don't get the DispatchStateChanged() callback.
Have any messages arrived?
Havoc
More information about the dbus
mailing list