2

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?

4

1 回答 1

1

In the new version of the boost it's fixed. See this.

于 2019-05-27T09:14:51.460 回答