A C++17 library that enables two separate processes to exchange serialized messages through a shared memory message queue, without explicit callbacks or notifications.
Built on top of Boost.Interprocess message queues and Boost.Serialization for automatic object serialization/deserialization across process boundaries.
Process A (TX) Process B (RX)
┌──────────────┐ ┌──────────────┐
│ Neuron │ shared mem │ Neuron │
│ (transmit) │ ──────────────> │ (receive) │
│ │ message queue │ │
│ serialize -> │ send -> recv │ -> deserial. │
└──────────────┘ └──────────────┘
- Message — Serializable data container (header + body) using Boost text archives
- Neuron — IPC endpoint that is either a transmitter (
tx) or receiver (rx) on a named queue - MessageHandler — Registry that manages multiple Neurons for a process
- C++17
- Boost.Interprocess — POSIX shared memory message queues
- Boost.Serialization — Object serialization across process boundaries
sudo apt-get install libc6-dev g++ libboost-all-devcd message-handler
g++ --std=c++17 -pthread main.cpp message-handler.cpp neuron.cpp \
-o msg-handler -lboost_serialization -lrtOpen two terminals:
# Terminal 1 — start the receiver
./msg-handler rx
# Terminal 2 — start the transmitter
./msg-handler txIn the TX terminal, type a header and body (space-separated) and press Enter to send a message. The RX terminal will display received messages as they arrive.
message.hpp # Serializable Message class
message-handler/
main.cpp # Entry point — TX/RX mode selection
message-handler.h/cpp # Neuron registry/manager
neuron.h/cpp # IPC endpoint (send/receive via shared memory)
