2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-27 18:42:07 +00:00
Commit Graph

329 Commits

Author SHA1 Message Date
Christopher Kohlhoff
eb1f1131c1 Add executor-converting construction/assignment to ip::basic_resolver. 2020-11-02 14:03:10 +11:00
Christopher Kohlhoff
311d355ab4 Add experimental::as_single completion token adapter.
The as_single completion token adapter can be used to specify that the
completion handler arguments should be combined into a single argument.
For completion signatures with a single parameter, the argument is
passed through as-is. For signatures with two or more parameters, the
arguments are combined into a tuple.

The as_single adapter may be used in conjunction with use_awaitable and
structured bindings as follows:

    auto [e, n] = co_await socket.async_read_some(
        boost::asio::buffer(data), as_single(use_awaitable));

Alternatively, it may be used as a default completion token like so:

    using default_token = as_single_t<use_awaitable_t<>>;
    using tcp_socket = default_token::as_default_on_t<tcp::socket>;
    // ...
    awaitable<void> do_read(tcp_socket socket)
    {
      // ...
      auto [e, n] = co_await socket.async_read_some(boost::asio::buffer(data));
      // ...
    }
2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
c034e3906f Clarify when the select reactor is used on Windows. 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
b3c8f8ed5e Revert "Restore null pointer check for better performance."
This reverts commit 50b38b57e6. This
change was applied in the wrong spot and introduced an uninitialised
memory access. The corresponding entry in the Revision History has
also been removed.
2020-08-11 09:33:07 +10:00
Christopher Kohlhoff
fd68805a3f Update revision history. 2020-08-05 23:13:10 +10:00
Christopher Kohlhoff
2a0773e1e0 Add some basic documentation on standard executors support. 2020-08-05 23:13:10 +10:00
Christopher Kohlhoff
18deb3dc5f Document that there are multiple types of I/O execution context. 2020-08-05 22:54:41 +10:00
Christopher Kohlhoff
917e05ceb3 Clarify impact of any_io_executor change. 2020-08-05 22:51:20 +10:00
Christopher Kohlhoff
06f8c1f98d Add shape_type and index_type to static_thread_pool executor, as per specification. 2020-08-04 12:52:40 +10:00
Christopher Kohlhoff
e53feeb5bf Add constraints to strand<>'s constructor to prevent template instantiation recursion. 2020-07-31 18:47:27 +10: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
543c453423 Make blocking_t::always_t::is_preferable false as per specification. 2020-07-28 22:16:24 +10:00
Christopher Kohlhoff
db0d05de01 Fix typos. 2020-07-28 22:14:03 +10:00
Christopher Kohlhoff
bfdf118094 Fix reference to asio::query customisation point. 2020-07-28 22:12:31 +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
3ee1087d1c Add detailed descriptions for standard executor-related member functions. 2020-07-27 09:37:15 +10:00
Christopher Kohlhoff
87d0d486f2 Documentation generation tweaks. 2020-07-27 09:34:51 +10:00
Christopher Kohlhoff
c5d029aeba Interim revision history. 2020-07-10 10:25:42 +10:00
Christopher Kohlhoff
7506766744 Regenerate documentation. 2020-07-06 23:56:06 +10:00
Christopher Kohlhoff
d8af4e6287 Add new execution facilities to quick reference. 2020-07-06 23:53:55 +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
c06347a602 Documentation fix for the execution::allocator property. 2020-06-24 11:42:43 +10:00
Christopher Kohlhoff
c4adb6ff02 Regenerate documentation. 2020-06-23 11:29:09 +10:00
Christopher Kohlhoff
93eb961014 Add new execution facilities to quick reference. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
8ce21b0001 Add new executor type requirements. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
c55037795c Documentation generation tweaks for new execution facilities. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
5d65dba5c8 Fix copy/paste errors in "Networking TS compatibility" docs. 2020-06-22 23:16:39 +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
cb60b08ff5 Add source location support to handler tracking.
The BOOST_ASIO_HANDLER_LOCATION((file_name, line, function_name)) macro
may be used to inform the handler tracking mechanism of a source
location. This macro declares an object that is placed on the stack.

When an asynchronous operation is launched with location information, it
outputs lines using the <action> 'n^m', prior to the 'n*m' line that
signifies the beginning of the asynchronous operation. For example:

    @asio|1589423304.861944|>7|ec=system:0,bytes_transferred=5
    @asio|1589423304.861952|7^8|in 'async_write' (./../../../include/asio/impl/write.hpp:330)
    @asio|1589423304.861952|7^8|called from 'do_write' (handler_tracking/async_tcp_echo_server.cpp:62)
    @asio|1589423304.861952|7^8|called from 'operator()' (handler_tracking/async_tcp_echo_server.cpp:51)
    @asio|1589423304.861952|7*8|socket@0x7ff61c008230.async_send
    @asio|1589423304.861975|.8|non_blocking_send,ec=system:0,bytes_transferred=5
    @asio|1589423304.861980|<7|

If std::source_location or std::experimental::source_location are
available, the use_awaitable_t token (when default-constructed or used
as a default completion token) will also cause handler tracking to
output a source location for each newly created asynchronous operation.
A use_awaitable_t object may also be explicitly constructed with location
information.
2020-06-22 20:46:29 +10:00
Christopher Kohlhoff
c0999c8e69 Revision history. 2020-04-22 21:52:28 +10:00
Christopher Kohlhoff
c9dadbd239 Update tutorial text to use current resolver API. 2020-04-22 18:38:07 +10:00
Christopher Kohlhoff
c506fc5f9a Replace '\n' with '[br]' in documentation. 2020-04-21 17:59:58 +10:00
Christopher Kohlhoff
325d3526c0 Update POSIX links. 2020-04-21 17:59:45 +10:00
Christopher Kohlhoff
c2795229e9 Remove unused local variable. 2020-04-08 18:12:32 +10:00
Christopher Kohlhoff
2094aa8ca4 Use boost.bind placeholders from boost::placeholders namespace. 2020-04-08 18:05:13 +10:00
Christopher Kohlhoff
371f4de392 Fix use of rebind_executor in use_awaitable.as_default_on. 2020-04-08 17:43:00 +10:00
Christopher Kohlhoff
94416dec93 Regenerate documentation. 2020-04-07 11:46:49 +10:00
Christopher Kohlhoff
53c56a857d Add link to C++14 examples section. 2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
85108a9f57 Speed up documentation generation. 2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
70e2c7db78 Update overview to reflect that handlers are only required to be move constructible. 2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
62dad58386 Add ssl::host_name_verification.
The ssl::host_name_verification class is a drop-in replacement for
ssl::rfc2818_verification, which it supersedes. The
ssl::rfc2818_verification class has been marked as deprecated.

Thanks to Arvid Norberg for providing the implementation.
2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
4b552cfd5b Update copyright notices. 2020-04-07 11:15:42 +10:00
Christopher Kohlhoff
5b6dc5ba74 Update diagrams to use io_context rather than io_service. 2019-12-05 00:34:39 +11:00
Christopher Kohlhoff
4bb5257f45 Revision history. 2019-12-05 00:18:44 +11:00
Christopher Kohlhoff
ffa958f1f4 Regenerate documentation. 2019-12-04 23:47:31 +11: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