Re: DBusWatch function, DBusTimeout functions Why these functions is needed ?
Денис Котов <[email protected]>
| Newsgroups | gmane.comp.freedesktop.dbus |
|---|---|
| Message-ID | <CAPKSe_6EHwz7er9zzrnRPd4-FPOXvTCcSzPxmPqrmG-YAxG-Pg@mail.gmail.com> |
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 <[email protected]> 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 > [email protected] > https://lists.freedesktop.org/mailman/listinfo/dbus > -- *Best RegardsDenis Kotov* _______________________________________________ dbus mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dbus