Commit Graph

1359 Commits

Author SHA1 Message Date
Christopher Kohlhoff
c0fa42a19b Make the executor_work_guard move constructor noexcept. 2019-02-28 20:11:40 +11:00
Christopher Kohlhoff
356750d694 Don't allow thread_pool locking to be set by BOOST_ASIO_CONCURRENCY_HINT_ macros.
Conservatively prevent the thread_pool's internal locking behaviour from
being changed via the BOOST_ASIO_CONCURRENCY_HINT_ macros, as there is
no way to use a thread_pool object in a purely single-threaded use case
anyway. This change also fixes a conversion warning.
2019-02-28 20:10:32 +11:00
Christopher Kohlhoff
0db2eb8eaa Disambiguate enable_if and native_handle_type. 2019-02-28 00:03:46 +11:00
Christopher Kohlhoff
483f3d32d6 Repeat typedefs in derived class templates to fix gcc compile error on Windows. 2019-02-28 00:03:14 +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
522d21c616 Added constructor for local::basic_endpoint from string_view. 2019-02-27 23:51:26 +11:00
Christopher Kohlhoff
c5bffba77d Add noexcept qualifier to ip::basic_endpoint class. 2019-02-27 23:50:28 +11:00
Christopher Kohlhoff
aa4483ab0e Add noexcept qualifier to ip::address_v6 class. 2019-02-27 23:49:35 +11:00
Christopher Kohlhoff
07898cafc6 Add noexcept qualifier to ip::address_v4 class. 2019-02-27 23:49:08 +11:00
Christopher Kohlhoff
414af97664 Add noexcept qualifier to ip::address class. 2019-02-27 23:48:37 +11:00
Christopher Kohlhoff
9e66a797c2 Merge asio from 'develop'. 2019-02-20 19:05:34 -10:00
Christopher Kohlhoff
035775462e Update windows::overlapped_ptr to support custom I/O executors. 2019-02-20 18:45:53 -10:00
Christopher Kohlhoff
e8e370c9ca Fix completion signatures used for ssl::stream's async_handshake and async_shutdown. 2019-02-18 23:07:24 -10:00
Christopher Kohlhoff
1c531d2618 Change archetype completion token's handler to require exact signature. 2019-02-18 23:06:57 -10:00
Christopher Kohlhoff
c7bbd30491 Fix compile error in serialization example. 2019-02-17 20:00:35 -10: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
b572bfbc21 Remove deprecated handler_type and single-argument async_result. 2019-02-17 20:00:05 -10:00
Christopher Kohlhoff
ae04c26689 Update copyright notices. 2019-02-17 19:59:39 -10:00
Christopher Kohlhoff
59066d80b2 Add custom I/O executor support to I/O objects.
All I/O objects now have an additional Executor template parameter. This
template parameter defaults to the asio::executor type (the polymorphic
executor wrapper) but can be used to specify a user-defined executor
type.

I/O objects' constructors and functions that previously took an
asio::io_context& now accept either an Executor or a reference to a
concrete ExecutionContext (such as asio::io_context or
asio::thread_pool).

One potential point of breakage in existing user code is when reusing an
I/O object's io_context for constructing another I/O object, as in:

    asio::steady_timer my_timer(my_socket.get_executor().context());

To fix this, either construct the second I/O object using the first I/O
object's executor:

    asio::steady_timer my_timer(my_socket.get_executor());

or otherwise explicitly pass the io_context:

    asio::steady_timer my_timer(my_io_context);
2019-02-17 19:59:29 -10:00
Christopher Kohlhoff
a72fbb0b86 Remove deprecated get_io_context and get_io_service functions. 2019-02-17 19:59:20 -10:00
Christopher Kohlhoff
0b2db4b84e Remove deprecated services support. 2019-02-17 19:59:01 -10:00
Christopher Kohlhoff
689a98cf84 Use separate recycled memory slot for polymorphic executor. 2019-02-17 19:58:53 -10:00
Christopher Kohlhoff
7c8c58b488 Merge asio 1.12.2 from 'develop'. 2018-12-05 14:27:08 +11: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
4b44dd8b59 Fix long lines. 2018-12-05 13:40:03 +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
e8f114260f Use new form of async_accept where socket is moved into the completion handler. 2018-12-05 13:30:20 +11:00
Christopher Kohlhoff
29bd1cb9ef Execution contexts must be publicly derived from asio::execution_context. 2018-12-05 13:29:23 +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
486843019a Indicate replacements for deprecated overloads. 2018-12-05 13:24:35 +11:00
Christopher Kohlhoff
c4f23d5fd5 Fix brief description of buffer() overload for non-const std::string. 2018-12-05 13:23:39 +11:00
Christopher Kohlhoff
f140eae657 Merge asio 1.12.2 beta from 'develop'. 2018-11-07 09:27:08 +11:00
Christopher Kohlhoff
5ac54042c9 Add interim revision history. 2018-11-07 09:20:35 +11:00
Christopher Kohlhoff
c3c769f41d Version bump. 2018-11-07 08:58:44 +11:00
Christopher Kohlhoff
1b6cd9e80c Add new header file required by previous commit. 2018-11-06 00:01:16 +11:00
Christopher Kohlhoff
84b95e1d8d Fix detection of std::future with libstdc++. 2018-11-05 23:12:24 +11:00
Christopher Kohlhoff
2e5ecdc897 Fix compile error in regex overload of read_until. 2018-11-05 23:11:48 +11:00
Christopher Kohlhoff
b9add379a7 Clear the heap index for removed timers.
Fixes timer heap corruption that can occur after move assignment of
a cancelled timer.
2018-11-05 23:11:16 +11:00
Christopher Kohlhoff
43874d5497 Fix detection of std::experimental::string_view and std::string_view with newer clang/libc++. 2018-11-05 23:10:45 +11:00
Christopher Kohlhoff
c6875a6fb3 Add compile-time test for TLSv1 presence. 2018-11-05 23:10:15 +11:00
Christopher Kohlhoff
f5ea76146f Fix macro used to test for TLS v1.2 support. 2018-11-05 23:09:46 +11:00
Christopher Kohlhoff
8b716c95b3 Fix typo in ssl::stream::async_write_some documentation. 2018-11-05 23:08:46 +11:00