Hello<br><br>Earlier I tried using the low level bindings of dbus api to listen for signals. The dbus signal listener used to miss out some signals. It used the following snippet<br><br><i style="font-family: courier new,monospace;">dbus_connection_read_write(conn,0);<br>
msg = dbus_connection_pop_message(conn);<br>if ( NULL == msg ){<br> usleep(1000);<br> continue;<br>}</i><br><br>I re-wrote the code using glib, to use the glib mainloop.I didn't get how to make the dbus-server listen to signals so I used the method-call-with-no-reply option. I modified the code present at following link <a href="http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Platform_Development_Chinook/APPENDIX_D_Source_code_for_the_GLibDBus_synchronous_example.html">maemo</a> . During the tests I observed that not a single method calls were missed when the bus was flooded with dbus-send's but when the interval of calling the message increased like say 60 secs then the server would miss out the method_call's. <br>
<br>Could anyone explain this. I believed if the message queue is clogged-up then there are chances of missing out signals/method_call . But here the case is just the opposite, when flooding happens then every signal/method_call is received, but if there is no flooding, signals/method_call's are lost.<br>
<br>I am attaching the code in my-dbus-server.zip . <br><ul><li>value-dbus-interface.xml -- is used to generate the header files using dbus-binding-tool . <br></li><li>my-server.c and commons-def.h -- are the part of glib -- c code. <br>
</li><li>my-server.conf -- is the configuration file to be placed under /etc/dbus-1/system.d/ ( I restarted messagebus daemon after this ). </li><li>Makefile -- compiles the code</li><li>random_dbus_signal.sh -- is the client side script which sleeps for random seconds and then wake up and calls a method of the server -- uses dbus-send --system --type=method_call</li>
<li>results -- performance observations.<br></li></ul><br>-- <br>Regards,<br>Abhijeet<br>