2

I've created a boost::message_queue by the following way:

namespace bipc = boost::interprocess;

...

try {
    bipc::message_queue::remove("EDBA90AC-289D-4825-98D9-F85185041676");

    // The below throws exception, no matter what's the name of the queue...

    boost::shared_ptr<bipc::message_queue> mq(new bipc::message_queue(bipc::create_only, "EDBA90AC-289D-4825-98D9-F85185041676", 32767, 256));

    ...
} catch (std::exception &e) {
    std::cout << "exception: " << e.what() << std::endl;
}

Now, I cannot get it to work, since the mq-creation throws every time the following exception

exception: invalid string position

This used to work fine with Boost version prior to 1.42, but not anymore. The documentation of Boost's message_queue hasn't changed, so no help from there. What am I doing wrong here?

1 Answer 1

3

You cannot name an interprocess mechanism with '-' inside. It's written in the documentation:

* Starts with a letter, lowercase or uppercase, such as a letter from a to z or from A to Z. Examples: Sharedmemory, sharedmemory, sHaReDmEmOrY...
* Can include letters, underscore, or digits. Examples: shm1, shm2and3, ShM3plus4...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.