[fpc-pascal] D-Bus. Non blocking listening for signals

dibo20 at wp.pl dibo20 at wp.pl
Sun Jan 2 20:42:02 CET 2011


W dniu 02.01.2011 20:11, Henry Vermaak pisze:
> On 2 January 2011 18:49,<dibo20 at wp.pl>  wrote:
>> Hi,
>>
>> Month ago I posted a bug (http://bugs.freepascal.org/view.php?id=18117)
>> Admin give me solution and feedback, but this solution doesn't work well and
>> i think he don't read my last comment.
>> So, maybe someone have this same problem. There is good demo for d-bus
>> rewrited line by line from official C example. It works fine, but this is
>> console demo. This demo listen for signals in main loop. In GUI application,
>> this example blocks user interface. I received a solution to use
>> Application.OnIdle event for check for signal. It works, but not detect all
>> signals. If host send 10 this same signals, my application detect only 4-6.
>> This problem raise after upgrade d-bus interface from 0.92 to 1.2.16 two
>> months ago. Previously, I could use timers and threads for listening
>> signals.
> You may already know this, but it may help to point out that the
> OnIdle event won't fire if there are no other events.  For example,
> you'll have to move your mouse or hit the keyboard for the OnIdle
> event to be called.  I don't know if this will affect talking to dbus
> (does it queue up the signals?).
>
> Henry
Yes, but I noticed that when there are no events, OnIdle is fired even 
so (at 5 seconds cycle). I thought it was enough to catch signal, but 
maybe it's too long and signals may have short live. C example uses glib 
main loop to check signals. I see that free pascal have some glib 
librarys. Can I somehow use it (I do not know what it is)? I need this 
solution only for linux



More information about the fpc-pascal mailing list