D-Bus connection with pselect()

Michael Pozhidaev msp at altlinux.ru
Sun Oct 30 20:31:03 PDT 2011


Hello, everybody!

It is my first posting to this list. I have one question about D-Bus.
Please, give me recommendation, what is the better thing to do!

Now I have one small linux service built on client/server
structure. The server contains everything in single process and answers to
client requests by using pselect() system call. This pselect() call also
handles two additional file descriptions to allow non-blocking read
operation when available data to read is present.

Now I want to add D-Bus support to my service and there is one question:
can I use my already existing pselect() system call to handle D-Bus
messages when there are present in my D-Bus connection? I have found
there is blocking function to wait next D-Bus message and the function
to check if new message is present but I didn't find anything
appropriate to use with select() or pselect() messages. I use pselect()
because there is the requirement to handle signals.

Of course, I can create one more process to listen D-Bus messages in
blocking mode and send some data through the pipe to my pselect() but is
it the single way I can use? And I don't want to use glib D-Bus API,
only native libdbus without any additional glib support to reduce
dependencies.

Thanks to everybody!
-- 
Michael Pozhidaev. Tomsk, Russia.
Russian info page: http://www.marigostra.ru/


More information about the dbus mailing list