11 Commits

Author SHA1 Message Date
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Rene Rivera
a31cca5ec1 Add support for modular build structure. 2024-10-31 21:42:07 +11:00
Christopher Kohlhoff
c83ee18458 Clean up spurious white space. 2024-06-27 23:01:17 +10:00
Christopher Kohlhoff
561e752d92 Update examples to use deferred as the default. 2024-06-26 22:42:54 +10:00
Christopher Kohlhoff
c36d3ef338 Update copyright notices. 2024-03-05 07:51:17 +11:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
9e03478ba1 Add range-based experimental::make_parallel_group().
Added new overloads of experimental::make_parallel_group that may be used
to launch a dynamically-sized set of asynchronous operations, where all
operations are the same type. For example:

  using op_type = decltype(
      socket1.async_read_some(
        boost::asio::buffer(data1),
        boost::asio::deferred
      )
    );

  std::vector<op_type> ops;

  ops.push_back(
      socket1.async_read_some(
        boost::asio::buffer(data1),
        boost::asio::deferred
      )
    );

  ops.push_back(
      socket2.async_read_some(
        boost::asio::buffer(data2),
        boost::asio::deferred
      )
    );

  boost::asio::experimental::make_parallel_group(ops).async_wait(
      boost::asio::experimental::wait_for_all(),
      [](
          std::vector<std::size_t> completion_order,
          std::vector<boost::system::error_code> e,
          std::vector<std::size_t> n
        )
      {
        for (std::size_t i = 0; i < completion_order.size(); ++i)
        {
          std::size_t idx = completion_order[i];
          std::cout << "socket " << idx << " finished: ";
          std::cout << e[idx] << ", " << n[idx] << "\n";
        }
      }
    );

Thanks go to Klemens Morgenstern for supplying part of this implementation.
2022-11-03 00:48:45 +11:00
Christopher Kohlhoff
f7356fbe90 Move append to the asio namespace.
This is no longer an experimental facility. The names append and
append_t have been temporarily retained as deprecated entities under
the asio::experimental namespace, for backwards compatibility.
2022-06-30 00:43:16 +10:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
b6bd05ae45 Fixes compiler error "error: 'asio::posix' has not been declared" on Windows 10 with MSYS Mingw64 10.3.0 2021-10-17 11:02:22 +11:00
Christopher Kohlhoff
1c3c80d778 Make experimental::parallel_group compatible with C++14. 2021-07-01 10:52:01 +10:00