I have this code:
boost::asio::io_service ios;
std::vector<char> buf(20);
bp::async_pipe ap(ios, "\\\\.\\pipe\\SamplePipe");
boost::asio::async_read(ap, boost::asio::buffer(buf),
[](const boost::system::error_code &ec, std::size_t size) {});
ios.run();
Now, I execute echo 42 > \\.\pipe\SamplePipe
in the cmd and expect an asynchronous read to the buffer to occur. But instead I get the following error: "All pipe instances are busy." Can somebody please explain to me why this is happening and how i can fix it?