Use DBus daemon to exchange message from C application to python application
<p>Hi I am pretty new to DBus daemon and would like to accomplish simple message exchange between C application and python application, which are running on custom linux-like environment. My understanding is</p>

<ol>
<li>First, start dbus-daemon from init file </li>
<li>Register the C application and the python application to the D-BUS</li>
<li>Send message
(it's just a simple string) on the bus between these 2 applications.</li>
</ol>

<p>My questions are regarding (2) and (3) above. How can C application and python application register to the same bus?</p>

<p>Also, what APIs need to be invoked to send string messages between these 2 applications?</p>

<p><em>[You asked for simple message passing]</em> Do you really need DBus?</p>

<p>If you're asking for simple message passing between a C app and Python, why not use a message-passing library like Rabbit/ZeroMQ? Those already solve all the issues related to passing/receiving messages.</p>

<p>And, if you want to keep dependencies to a minimum, you could use a UNIX socket or even some simple TCP/UDP datagrams.</p>

<p>EDIT: Since I'm trying to convince you to research ZeroMQ as your IPC platform and how simple it is, here's a sample C "Client" sending a complete datagram to the server, which replies back.</p>

<p><a href="http://zguide.zeromq.org/c:hwclient" rel="nofollow">ZeroQM Client Example in C</a></p>

<p>And the server is just as simple:</p>

<p><a href="http://zguide.zeromq.org/c:hwserver" rel="nofollow">ZeroQM Server Example in C</a></p>

python linux dbus