Re: DBusWatch function, DBusTimeout functions Why these functions is needed ?

Thiago Macieira <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <1799456.V7LEy6cXAn@tjmaciei-mobl1>
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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.