DBusWatch function, DBusTimeout functions Why these functions is needed ?

Денис Котов redradist at gmail.com
Mon Dec 26 14:54:38 UTC 2016


Hi Thiago,

Thanks for explanation.

I little bit figure out how to work with Watchs from this link
https://lists.freedesktop.org/archives/dbus/2007-October/008859.html .
But I have not still understood how to work with timeout. This timeout
(add_timeout and remove_timeout) what are their purposes ? It is timeout
that given by libdbus to handle events for specific file descriptor or what
is it ?
Maybe you have some good example for timeout ?

On 26 December 2016 at 13:37, Thiago Macieira <thiago at kde.org> wrote:

> Em sábado, 24 de dezembro de 2016, às 20:02:05 BRST, Денис Котов escreveu:
> > Hi All,
> >
> > Currently I have faced with understanding of watch and timeout functions
> in
> > libdbus.
> > I do not quit understand why they are needed.
>
> Well, they are needed to let libdbus know when one of its file descriptors
> has
> activity or is ready for activity, or when a timer expires.
>
> > From description I understand they are needed to check state of socket.
> If
> > something changes then from libdbus I will receive this message and I
> have
> > either to read something or to write something to socket.
>
> The other way around. They are used to tell libdbus that the socket has
> activity so it will read, or that the socket is ready for writing so it
> will
> write.
>
> > It means that I should not create infinite while loop, but register
> > callbacks and when will be possibility I will write to out-queue or read
> to
> > in-queue, am I right ?
>
> Your infinite loop has in its centre a call to select() or poll().
>
> >
> > And maybe some brief explanation what is DBusTimeout function ?
>
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>    Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dbus
>



-- 

*Best RegardsDenis Kotov*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20161226/9a7440f1/attachment.html>


More information about the dbus mailing list