Fwd: simple application without main loop

Fritz Code codefritz at googlemail.com
Thu May 22 10:01:20 PDT 2008


Hi,

sorry the last mail was not yet finished, but my mail client sent it out
anyway.

So I thought I can use something like this to receive and process message
for 10 seconds. Of course I have set up a handler function in order to
process the messages with dbus_connection_add_filter.

while( dbus_connection_read_write_dispatch(getBus(),10000) )

So during the specific time (e.g 10 seconds) my application can be blocked,
by polling for new messages. but it must be ensured that after this amount
of time the loop gets exited.

thanks.
Fritz



---------- Forwarded message ----------
From: Fritz Code <codefritz at googlemail.com>
Date: Thu, May 22, 2008 at 6:56 PM
Subject: simple application without main loop
To: dbus at lists.freedesktop.org


Hi,

I wann  write a simple application and if possible without a main loop.
All the application does is to send a signal to the bus.
Then is should receive and process replys for a specific time e.g. 10
seconds.
I've tried to do this with a loop like this:
 while( dbus_connection_read_write_dispatch(getBus(),-1) )
    ;


-- 
Regards,
--Codefritz






-- 
Regards,
--Codefritz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080522/6cc0e650/attachment.htm 


More information about the dbus mailing list