1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
10 #include <boost/interprocess/detail/config_begin.hpp>
12 #include <boost/interprocess/ipc/message_queue.hpp>
16 using namespace boost::interprocess
;
21 //Erase previous message queue
22 message_queue::remove("message_queue");
24 //Create a message_queue.
26 (create_only
//only create
27 ,"message_queue" //name
28 ,100 //max message number
29 ,sizeof(int) //max message size
33 for(int i
= 0; i
< 100; ++i
){
34 mq
.send(&i
, sizeof(i
), 0);
37 catch(interprocess_exception
&ex
){
38 std::cout
<< ex
.what() << std::endl
;
45 #include <boost/interprocess/detail/config_end.hpp>