Reputation: 249
I am trying to implement a messaging system between two processes with boost.interprocess and message_queue.
First problem: One queue can only be used for sending messages from process A to B, not B to A.
Thus, I am using two queues in both processes. Process A listens/receives at Queue-A and sends on Queue-B; Process B listens/receives at Queue-B and sends on Queue-A.
I am unable to get the to system work with both queues. Depending on the ordering of the processes calling boost::interprocess::message_queue(boost::interprocess::open_or_create,...)
or
boost::interprocess::message_queue(boost::interprocess::open_only,...)
either one Queue works or the other or neither.
Even if Process A creates Queue-A and Queue-B and Process B opens Queue-A and Queue-B, only. In one direction boost::interprocess is stuck at the receive-function and never awakes.
1) Is it possible to get bidirectional messaging/signalling to work with interprocess::message_queue using two queues in each process? 2) Is there a better way get bidirectional messaging without using message_queue?
Upvotes: 1
Views: 472
Reputation: 249
I did not receive any comments on this. The solution was to not use boost::interprocess::message_queue. With the help of boost/interprocess/shared_memory_object I did write on my own a new, simple library for unidirectional interprocess messaging. https://github.com/svebert/InterprocessMsg
Upvotes: 3