ipc-sample

note: checkout with submodules.

Inter-Process Communications (IPC)

Aeron is an efficient message transport library for C++ and Java. It supports various channel configuration options including UDP ("udp://...." channels) and shared memory ("aeron:ipc" channel). Each channel can have multiple streams of different data, set up using "stream id".

It requires 3 parts to run

  • Driver: broker that often runs in a separate process
  • Publisher: sends binary data on a channel and stream id (in this case image data from C++)
  • Subscriber: receives binary data (in this case a JavaFX UI)

Testing

Serialization

For converting the image data to a binary format I'm currently using protobuf v3.2.0. It is a relatively old version, but I didn't have time to figure out an appropriate cmake configuration for a new version (and it doesn't matter for this demo).

The protobuf files can be re-generated using

cd protocol
protoc-3.2.0-win32.exe --cpp_out=. rima.proto