Curious how dbus could be used for process to process communication,
This is a minimal example of a project with three applications. A client and server in C++ and a client in golang.
The Server listens on dbus for a message. ./build/server
. The client sends a message to the server, ./build/client/client "hello world"
.
The server will now print hello world and tell the client thanks.
clang or gcc, make, cmake,and sdbus-cpp which is used as a high level dbus library.
for detailed build instructions checkout the dockerfile which details how the project is built on arch linux.
To test I suggest testing in docker-compose.
docker-compose build
- in one terminal,
docker-compose up
- In another terminal,
docker-compose exec dbuscpp /bin/bash -c "source .env && ./build/client 'hello world'"
to test the C++ client or for golangdocker-compose exec dbuscpp /bin/bash -c "source .env && ./go/src/client/dbus 'hello world'"