I am using boost interprocess message queue in windows, however I met a issue that it will throw an error when max_msg_size doesn't equals to buffer_size,part of my code is as below:
//process A
message_queue::remove(name);
m_MQ = std::make_unique<message_queue>(create_only, name,2000,300);
m_MQ->try_send(buffer, buffer_size, 0);
//process B
m_MQ = std::make_unique<message_queue>(open_only, name);
m_MQ->try_receive(buffer, buffer_size, recvd_size, priority);
In this case, if buffer_size
doesn't equal to 300, it will throw boost::interprocess_exception::library_error
and I cannot pass variable length buffer any more.
Thanks so much.