<div dir="ltr">Hi <span style="font-size:12.8px;font-weight:bold;white-space:nowrap">Thiago,</span><div><span style="font-size:12.8px;font-weight:bold;white-space:nowrap"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap">Thanks for explanation.</span></div><div><span style="font-size:12.8px;white-space:nowrap"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap">I little bit figure out how to work with Watchs from this link </span><a href="https://lists.freedesktop.org/archives/dbus/2007-October/008859.html" target="_blank" style="font-size:12.8px;white-space:nowrap">https://lists.<wbr>freedesktop.org/archives/dbus/<wbr>2007-October/008859.html</a> .</div><div>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 ?</div><div>Maybe you have some good example for timeout ?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 December 2016 at 13:37, Thiago Macieira <span dir="ltr"><<a href="mailto:thiago@kde.org" target="_blank">thiago@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Em sábado, 24 de dezembro de 2016, às 20:02:05 BRST, Денис Котов escreveu:<br>
> Hi All,<br>
><br>
> Currently I have faced with understanding of watch and timeout functions in<br>
> libdbus.<br>
> I do not quit understand why they are needed.<br>
<br>
</span>Well, they are needed to let libdbus know when one of its file descriptors has<br>
activity or is ready for activity, or when a timer expires.<br>
<span class=""><br>
> From description I understand they are needed to check state of socket. If<br>
> something changes then from libdbus I will receive this message and I have<br>
> either to read something or to write something to socket.<br>
<br>
</span>The other way around. They are used to tell libdbus that the socket has<br>
activity so it will read, or that the socket is ready for writing so it will<br>
write.<br>
<span class=""><br>
> It means that I should not create infinite while loop, but register<br>
> callbacks and when will be possibility I will write to out-queue or read to<br>
> in-queue, am I right ?<br>
<br>
</span>Your infinite loop has in its centre a call to select() or poll().<br>
<span class=""><br>
><br>
> And maybe some brief explanation what is DBusTimeout function ?<br>
<br>
<br>
--<br>
</span>Thiago Macieira - thiago (AT) <a href="http://macieira.info" rel="noreferrer" target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" rel="noreferrer" target="_blank">kde.org</a><br>
Software Architect - Intel Open Source Technology Center<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dbus" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dbus</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Best Regards<br>Denis Kotov</b><br></div></div>
</div>