1

Hi I am trying to implement interprocess communication between 32/64 binaries by boost message_queue on linux

According to 64bit and 32bit process intercommunication boost::message_queue, here is my implementation:

// sender.cc, x86_64
typedef boost::interprocess::message_queue_t<offset_ptr<void, int32_t, uint64_t>> Ipmq;
int main() {
    Ipmq mq(create_only, "mq", 100, sizeof(int32_t));
    int32_t i = 42;
    mq.send(&i, sizeof(int32_t), 0);
}
// receiver.cc, x86
typedef boost::interprocess::message_queue_t<offset_ptr<void, int32_t, uint64_t>> Ipmq;
int main() {
    Ipmq mq(open_only, "mq");
    int32_t i;
    uint32_t rsize;
    uint32_t p;
    mq.receive(&i, sizeof(int32_t), rsize, p);
}

sender works while receiver throws:

boost::interprocess::interprocess_exception what(): boost::interprocess_exception::library_error

and aborts when calling mq.receive(...).

Could you tell me if it is possible to ipc between 32/64 binaries using boost message_queue ?

If not, could you tell me any other ipc method on linux whose receiver can set a time out?

Thanks

hczstev
  • 41
  • 4

0 Answers0