2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-20 04:22:10 +00:00

107 Commits

Author SHA1 Message Date
Christopher Kohlhoff
b87a07f2cc Update doc generation config. 2025-11-05 20:43:18 +11:00
Christopher Kohlhoff
a96885268f Add documentation note on basic_signal_set's async signal safety. 2025-08-06 22:16:18 +10:00
Christopher Kohlhoff
cb99678035 Remove deadline_timer and time_traits from the convenience header. 2025-07-07 20:44:27 +10:00
Christopher Kohlhoff
960482db0f Fix broken links in documentation. 2025-04-02 23:30:56 +11:00
Christopher Kohlhoff
a8ac04d8d6 Update async_result documentation to reflect current type requirements. 2025-04-01 22:02:47 +11:00
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Christopher Kohlhoff
b0fe7b2df8 Add disposition requirements to the documentation. 2024-10-31 20:31:20 +11:00
Christopher Kohlhoff
e3bbcc412a Remove deprecated dispatch and post members from io_context and io_context::strand. 2024-10-23 21:20:42 +11:00
Christopher Kohlhoff
e2ddaf7f21 Regenerate documentation. 2024-07-09 22:05:30 +10:00
Christopher Kohlhoff
1946fa3c15 Remove unused type requirements. 2024-04-03 21:15:42 +11:00
Christopher Kohlhoff
842b1c2ee0 Fix doc links for deduced initiating function return types. 2024-03-05 07:53:37 +11:00
Christopher Kohlhoff
c36d3ef338 Update copyright notices. 2024-03-05 07:51:17 +11:00
Christopher Kohlhoff
e54e540363 Remove leading space from code snippets. 2023-12-05 23:33:43 +11:00
Christopher Kohlhoff
da99786534 Update for newer doxygen. 2023-11-09 00:49:42 +11:00
Christopher Kohlhoff
23e7730379 Fix doc generation for literal operators. 2023-03-07 08:20:23 +11:00
Christopher Kohlhoff
adfeed2b5d Add any_completion_handler to the documentation. 2023-03-07 00:04:56 +11:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
5bbdc9b709 Change spawn() to be a completion token-based async operation.
Added new spawn() overloads that conform to the requirements for
asynchronous operations. These overloads also support cancellation. When
targeting C++11 and later these functions are implemented in terms of
Boost.Context directly.

The existing overloads have been retained but are deprecated.
2022-06-30 01:18:45 +10:00
Christopher Kohlhoff
d35b87ff27 Update documentation for dispatch, post, and defer. 2022-03-04 21:06:50 +11:00
Christopher Kohlhoff
7162c9675d Rework reference documentation in terms of completion tokens. 2022-03-02 22:13:21 +11:00
Christopher Kohlhoff
9208208d11 Add overview of asynchronous model. 2022-03-02 22:13:21 +11:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
495e6367af Add experimental support for channels.
This adds experimental::channel and experimental::concurrent_channel.
Channels may be used to send completions as messages. For example:

  // Create a channel with no buffer space.
  channel<void(error_code, size_t)> ch(ctx);

  // The call to try_send fails as there is no buffer
  // space and no waiting receive operations.
  bool ok = ch.try_send(asio::error::eof, 123);
  assert(!ok);

  // The async_send operation blocks until a receive
  // operation consumes the message.
  ch.async_send(asio::error::eof, 123,
      [](error_code ec)
      {
        // ...
      });

  // The async_receive consumes the message. Both the
  // async_send and async_receive operations complete
  // immediately.
  ch.async_receive(
      [](error_code ec, size_t n)
      {
        // ...
      });
2021-11-04 01:56:32 +11:00
Christopher Kohlhoff
5b72b72b72 Improvements to asio::experimental::coro.
* Added overload so member functions can provide an explicit executor.
* Added co_spawn for coro tasks.
* Added reference and overview documentation.
* Adopted awaitable cancellation model.
* Refactored implementation.
2021-11-04 01:41:25 +11:00
Christopher Kohlhoff
0cc4c7093a Clean up doc generation to accommodate new features. 2021-07-07 22:47:10 +10:00
Christopher Kohlhoff
9cc511935c Experimental features don't have convenience headers. 2021-07-07 22:47:10 +10:00
Christopher Kohlhoff
0b0c4664d0 Add cancellation to reference documentation. 2021-06-28 10:14:54 +10:00
Christopher Kohlhoff
c970aba69b Use escaped names in index entries. 2021-03-04 15:45:56 +11:00
Christopher Kohlhoff
787d32a417 Add index entries for classes. 2021-03-04 09:09:00 +11:00
Christopher Kohlhoff
723982b867 Update copyright notices. 2021-02-25 08:29:05 +11:00
Christopher Kohlhoff
bbbda48bfb Mark constructors in synopses for nested classes and classes in sub-namespaces. 2020-07-30 10:40:56 +10:00
Christopher Kohlhoff
7ddf71b69b Exclude I/O objects' impl_ data members from documentation. 2020-07-28 22:10:58 +10:00
Christopher Kohlhoff
680130daf2 Mark constructors/destructors in class synopses. 2020-07-28 22:09:10 +10:00
Christopher Kohlhoff
7d3c889c60 Mark static members in class synopses. 2020-07-28 22:07:38 +10:00
Christopher Kohlhoff
365661a7e3 More documentation generation tweaks for new execution facilities. 2020-07-06 23:53:55 +10:00
Christopher Kohlhoff
0e6f996a94 Add documentation for execution concepts. 2020-07-06 23:31:31 +10:00
Christopher Kohlhoff
c55037795c Documentation generation tweaks for new execution facilities. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
3f12308c03 Add overloads of co_spawn that launch an awaitable.
This change allows us to write:

 co_spawn(executor,
     echo(std::move(socket)),
     detached);

instead of:

 co_spawn(executor,
     [socket = std::move(socket)]() mutable
     {
       return echo(std::move(socket));
     },
     detached);
2020-06-22 20:49:30 +10:00
Christopher Kohlhoff
85108a9f57 Speed up documentation generation. 2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
4b552cfd5b Update copyright notices. 2020-04-07 11:15:42 +10:00
Christopher Kohlhoff
6f0c944895 Fix cross referencing for InnerExecutor template parameters. 2019-12-04 23:40:58 +11:00
Christopher Kohlhoff
81dc9a91c2 Documentation for default completion tokens. 2019-12-04 23:40:58 +11:00
Christopher Kohlhoff
2f7af2e33c Update composed operations examples to use async_initiate and a new helper function async_compose. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
688ea91d69 Fix cross references. 2019-03-03 19:58:48 +11:00
Christopher Kohlhoff
9be88fb192 Add new DynamicBuffer_v2 which is CopyConstructible.
This change adds a new set of type requirements for dynamic buffers,
DynamicBuffer_v2, which supports copy construction. These new type
requirements enable dynamic buffers to be used as arguments to
user-defined composed operations, where the same dynamic buffer object
is used repeatedly for multiple underlying operations. For example:

  template <typename DynamicBuffer>
  void echo_line(tcp::socket& sock, DynamicBuffer buf)
  {
    n = boost::asio::read_until(sock, buf, '\n');
    boost::asio::write(sock, buf, boost::asio::transfer_exactly(n));
  }

The original DynamicBuffer type requirements have been renamed to
DynamicBuffer_v1.

New type traits is_dynamic_buffer_v1 and is_dynamic_buffer_v2 have been
added to test for conformance to DynamicBuffer_v1 and DynamicBuffer_v2
respectively. The existing is_dynamic_buffer trait has been retained and
delegates to is_dynamic_buffer_v1, unless BOOST_ASIO_NO_DYNAMIC_BUFFER_V1
is defined, in which case it delegates to is_dynamic_buffer_v2.

The dynamic_string_buffer and dynamic_vector buffer classes conform to
both DynamicBuffer_v1 and DynamicBuffer_v2 requirements.

When BOOST_ASIO_NO_DYNAMIC_BUFFER_V1 is defined, all support for
DynamicBuffer_v1 types and functions is #ifdef-ed out. Support for using
basic_streambuf with the read, async_read, read_until, async_read_until,
write, and async_write functions is also disabled as a consequence.

This change should have no impact on existing source code that simply
uses dynamic buffers in conjunction with asio's composed operations,
such as:

  string data;
  // ...
  size_t n = boost::asio::read_until(my_socket
      boost::asio::dynamic_buffer(data, MY_MAX),
      '\n');
2019-03-03 19:53:57 +11:00
Christopher Kohlhoff
350afe1bee Prevent implicit conversion with buffer_sequence_begin/end.
This change addresses an issue where a call to buffer_sequence_begin or
buffer_sequence_end could trigger an implicit conversion to const_buffer
or mutable_buffer. Whenever this implicit conversion occurred, the
return value of buffer_sequence_begin/end would point to a temporary
object.
2019-03-02 16:03:47 +11:00
Christopher Kohlhoff
94743a1a96 Remove experimental directory from documentation processing. 2019-03-02 16:00:44 +11:00
Christopher Kohlhoff
0568d3bf0b New async_result form with initiate() static member function.
The `async_result` template now supports a new form:

    template <typename CompletionToken, typename Signature>
    struct async_result
    {
      typedef /* ... */ return_type;

      template <typename Initiation,
          typename RawCompletionToken,
          typename... Args>
      static return_type initiate(
          Initiation&& initiation,
          RawCompletionToken&& token,
          Args&&... args);
    };

The `initiate()` function must:

* Transform the token into a completion handler object `handler`.

* Cause the invocation of the function object `initiation` as if
  by calling:

    std::forward<Initiation>(initiation)(
        std::move(handler),
        std::forward<Args>(args)...);

The invocation of `initiation` may be deferred (e.g. lazily evaluated),
in which case `initiation` and `args` must be decay-copied and moved
as required.

A helper function template `async_initiate` has also been added as a
wrapper for the invocation of `async_result<>::initiate`. For backward
compatibility, this function supports both the old and new async_result
forms.
2019-02-17 20:00:19 -10:00
Christopher Kohlhoff
ae04c26689 Update copyright notices. 2019-02-17 19:59:39 -10:00
Christopher Kohlhoff
2504d9ab25 Make distinction between overloads clearer. 2018-12-05 13:28:34 +11:00