Commit Graph

284 Commits

Author SHA1 Message Date
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
Christopher Kohlhoff
0cb51946bb Minor documentation fixes. 2019-12-03 19:59:09 +11:00
Christopher Kohlhoff
6e49032917 Require that Endpoint default constructor and move operations never throw. 2019-11-06 21:13:26 +11:00
Christopher Kohlhoff
244f0c3e8c Require that Protocol copy and move operations never throw. 2019-11-06 21:00:20 +11:00
Christopher Kohlhoff
8c66b23efc Regenerate documentation. 2019-08-06 19:46:14 +10:00
Christopher Kohlhoff
7dcc939287 Revision history. 2019-08-06 19:46:14 +10:00
Christopher Kohlhoff
da41f1c35e Remove 'experimental' qualifier from contents entry for Coroutines TS support. 2019-08-06 19:46:14 +10:00
chris.kohlhoff
3a95f8efea Fix typo in example targets. 2019-07-09 20:10:46 +10:00
chris.kohlhoff
db788cab40 Fix doxygen generation in tutorial. 2019-07-09 19:20:10 +10:00
Christopher Kohlhoff
ce7e3bbf4b Revision history. 2019-03-31 23:41:34 +11:00
Christopher Kohlhoff
27c6b3016c Remove BOOST_ASIO_ENABLE_OLD_SERVICES from documentation. 2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
2e19dc524b Add more missing entries to quick reference. 2019-03-31 22:20:48 +11:00
Christopher Kohlhoff
0340c15e49 Fix up dispatch() documentation. Clarify distinction between post() and defer(). 2019-03-07 16:17:18 +11:00
Christopher Kohlhoff
d4d0edd416 Copy new examples to documentation directory. 2019-03-06 22:48:32 +11:00
Christopher Kohlhoff
f2e6af2693 Regenerate documentation. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
95041862ae Remove experimental directory from documentation processing. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
b85528b585 Add new entities to quick reference. 2019-03-06 20:22:23 +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
b9600df415 Completion conditions now require move rather than copy.
The CompletionCondition type requirements have been relaxed such that
they only require MoveConstructible types instead of CopyConstructible.
2019-03-02 16:12:53 +11:00
Christopher Kohlhoff
83278307e1 Add ip::resolver_base to quick reference and cross reference it from ip::basic_resolver. 2019-03-02 16:09:08 +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
baca9a092f Promote coroutines TS support classes to asio namespace.
The awaitable<>, co_spawn(), this_coro, detached, and redirect_error
facilities have been moved from the asio::experimental namespace to
namespace asio. As part of this change, the this_coro::token() awaitable
has been superseded by the asio::use_awaitable completion token.

Please note that the use_awaitable and redirect_error completion tokens
work only with asynchronous operations that use the new form of
async_result with member function initiate(). Furthermore, when using
use_awaitable, please be aware that the asynchronous operation is not
initiated until co_await is applied to the awaitable<>.
2019-02-28 00:02:00 +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
a6008b6427 Update list of examples for doc generation. 2018-12-05 14:10:58 +11:00
Christopher Kohlhoff
186ab6eab9 Update revision history. 2018-12-05 14:10:58 +11:00
Christopher Kohlhoff
e19f5bdc94 Add examples showing how to write composed operations. 2018-12-05 14:10:58 +11:00
Christopher Kohlhoff
daf333881a Add documentation for change in concurrency_hint type. 2018-12-05 13:51:00 +11:00
Christopher Kohlhoff
5d3acf6aef Regenerate documentation. 2018-12-05 13:50:10 +11:00
Christopher Kohlhoff
cfb012268a Add C++11 version of SOCKS4 example. 2018-12-05 13:46:01 +11:00
Christopher Kohlhoff
c599605ce5 Add C++11 version of SSL example. 2018-12-05 13:38:52 +11:00
Christopher Kohlhoff
df899178fd Add C++11 version of timers example. 2018-12-05 13:35:57 +11:00
Christopher Kohlhoff
a25822b74c Add C++11 versions of timeouts examples. 2018-12-05 13:34:20 +11:00
Christopher Kohlhoff
2504d9ab25 Make distinction between overloads clearer. 2018-12-05 13:28:34 +11:00
Christopher Kohlhoff
6f3ab889f2 Fix library name. 2018-12-05 13:27:37 +11:00
Christopher Kohlhoff
5ac54042c9 Add interim revision history. 2018-11-07 09:20:35 +11:00
Christopher Kohlhoff
6cdd5782aa Fix typo in 'Streams, Short Reads and Short Writes' documentation section. 2018-11-05 23:03:16 +11:00
Christopher Kohlhoff
0104da0a41 Use heading elements to keep asynchronous requirements on one page. 2018-11-05 23:00:05 +11:00
Christopher Kohlhoff
fbe86d86b1 Updated revision history. 2018-04-03 22:55:21 +10:00
Christopher Kohlhoff
9941b40754 Add Coroutines TS overview and examples to documentation. 2018-04-03 22:55:21 +10:00
Christopher Kohlhoff
df94a3d0a2 Regenerate documentation. 2018-04-01 21:52:18 +10:00
Christopher Kohlhoff
0ffe337bda Distinguish legacy completion handlers (which must be CopyConstructible). 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
69d54db71f Update examples to use chrono rather than Boost.Date_Time.
N.B. The Windows-specific tick_count_timer example has been removed as
it has been superseded by timers based on the standard steady_clock.
It's also not clear how to map a wrapping time source to the standard
chrono concepts.
2018-04-01 15:28:38 +10:00