Commit Graph

2584 Commits

Author SHA1 Message Date
Christopher Kohlhoff
992a656e26 Mark posix descriptor classes' move constructors as noexcept. 2020-04-07 08:29:53 +10:00
Christopher Kohlhoff
8dc44bc23b Add more MSVC versions to appveyor configuration. 2020-04-07 08:29:53 +10:00
Christopher Kohlhoff
6720d4078a Add MSVC build support for /std:c++latest. 2020-04-07 08:29:53 +10:00
Christopher Kohlhoff
00157db09e Support C++20 concept syntax. 2020-04-07 08:29:53 +10:00
Christopher Kohlhoff
8bedc5aa3b When using gcc, use __cplusplus macro to determine language conformance. 2020-04-06 17:52:05 +10:00
Christopher Kohlhoff
9e1c9c6a60 Fix macro prefix. 2020-04-06 17:51:52 +10:00
Christopher Kohlhoff
7fba31fb7f Update copyright notices. 2020-04-06 17:51:19 +10:00
Christopher Kohlhoff
a304654bc6 asio version 1.16.0 released 2019-12-12 11:29:15 +11:00
Christopher Kohlhoff
91f57a966d Revision history. 2019-12-05 00:18:44 +11:00
Christopher Kohlhoff
88e8c0aade Regenerate documentation. 2019-12-04 23:47:31 +11:00
Christopher Kohlhoff
a7f2a0d6c3 Fix cross referencing for InnerExecutor template parameters. 2019-12-04 23:37:10 +11:00
Christopher Kohlhoff
b30941136b Documentation for default completion tokens. 2019-12-04 23:37:10 +11:00
Christopher Kohlhoff
d2e92ec40f Don't specify default token on some async_write overloads.
Eliminates an ambiguity.
2019-12-02 21:33:40 +11:00
Pawel Pery
42174675fb Start handler work again in case of restarting accept operation. 2019-12-02 21:11:21 +11:00
Christopher Kohlhoff
0033bc8d98 Specify default baud rate when opening serial port on Windows. 2019-12-02 21:00:41 +11:00
Christopher Kohlhoff
08f9a631af Fix constant used to initialise the serial port RTS control flag on Windows. 2019-12-02 20:58:48 +11:00
Christopher Kohlhoff
109df16082 Use feature-test macro for detecting return type deduction. 2019-12-02 20:53:40 +11:00
Christopher Kohlhoff
317895870d Minor documentation fixes. 2019-12-02 20:53:37 +11:00
Christopher Kohlhoff
df63c9585e More typenames required in ssl::stream. 2019-12-02 20:33:06 +11:00
Christopher Kohlhoff
8087252a0c Add noexcept qualifier to socket move constructors. 2019-11-06 08:32:06 +11:00
Christopher Kohlhoff
dd2243322b Require that Endpoint default constructor and move operations never throw. 2019-11-06 08:32:01 +11:00
Christopher Kohlhoff
35d12b3bfc Require that Protocol copy and move operations never throw. 2019-11-06 08:31:57 +11:00
Christopher Kohlhoff
70b0c5f3e4 Add noexcept qualifier to protocol accessors. 2019-11-06 06:33:35 +11:00
Christopher Kohlhoff
b317c8be09 Add typename to ssl::stream's initiation objects' executor_type typedefs. 2019-11-06 06:32:51 +11:00
Christopher Kohlhoff
0930d76385 Ensure the executor type is propagated to newly accepted sockets.
When synchronously or asynchronously accepting a new connection, but
without specifying an executor or execution context, the accept
operation will now correctly propagate the executor type from the
acceptor to the socket. For example, if your acceptor type is:

  basic_socket_acceptor<ip::tcp, my_executor_type>

then your accepted socket type will be:

  basic_stream_socket<ip::tcp, my_executor_type>
2019-10-31 20:19:31 +11:00
Christopher Kohlhoff
ddfa5f9d70 Add default completion tokens.
Every I/O executor type now has an associated default completion token
type. This is specified via the `default_completion_token` trait. This
trait may be used in asynchronous operation declarations as follows:

  template <
      typename IoObject,
      typename CompletionToken =
        typename default_completion_token<
          typename IoObject::executor_type
        >::type
    >
  auto async_foo(
      IoObject& io_object,
      CompletionToken&& token =
        typename default_completion_token<
          typename IoObject::executor_type
        >::type{}
    );

If not specialised, this trait type is `void`, meaning no default
completion token type is available for the given I/O executor.

The `default_completion_token` trait is specialised for the
`use_awaitable` completion token so that it may be used as shown in the
following example:

  auto socket = use_awaitable.as_default_on(tcp::socket(my_context));
  // ...
  co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.

In this example, type of the `socket` object is transformed from
`tcp::socket` to have an I/O executor with the default completion token
set to `use_awaitable`.

Alternatively, the socket type may be computed directly:

  using tcp_socket = use_awaitable_t<>::as_default_on_t<tcp::socket>;
  tcp_socket socket(my_context);
  // ...
  co_await socket.async_connect(my_endpoint); // Defaults to use_awaitable.
2019-10-31 20:18:46 +11:00
Christopher Kohlhoff
ca229e264a Use async_initiate in Windows-specific I/O objects. 2019-10-30 19:14:01 +11:00
Christopher Kohlhoff
5b126e3845 Add executor_type/get_executor to all initiation objects.
The asynchronous operations' initiation function objects now report
their associated I/O executor via the nested type `executor_type` and
member function `get_executor()`.

The presence of `executor_type` and `get_executor()` should be treated
as optional, and consequently it may be preferable to access them via
the `associated_executor` trait and the `get_associated_executor()`
helper function.
2019-10-30 19:14:01 +11:00
Christopher Kohlhoff
f681562d2d Add rebind_executor to all I/O object types.
The I/O objects provided by Asio now support the nested template type
`rebind_executor` as a way to generically rebind them to an alternative
I/O executor type. For example:

  using my_socket_type =
    tcp::socket::rebind_executor<my_executor_type>::other;
2019-10-30 19:14:01 +11:00
Christopher Kohlhoff
68d15f184c Use completion_token_for concept to constrain token parameters. 2019-10-30 19:14:00 +11:00
Christopher Kohlhoff
26207403cf Add concepts to support async_initiate.
This change introduces three new concepts:

* completion_signature<T>: Checks if T is a signature of the form R(Args...).

* completion_handler_for<T, Signature>: Checks if T is usable as a completion
  handler with the specified signature.

* completion_token_for<T, Signature>: Checks if T is a completion token that
  can be used with async_initiate and the specified signature.

For backward compatibility, use the macros ASIO_COMPLETION_SIGNATURE,
ASIO_COMPLETION_HANDLER_FOR, and ASIO_COMPLETION_TOKEN_FOR respectively.
These macros expand to `typename` when concepts are unsupported.
2019-10-30 19:14:00 +11:00
Christopher Kohlhoff
98186da7bc Use automatically deduced return types for all async operations.
C++14 or later is required to support completion tokens that use
per-operation return type deduction. For C++11 or earlier, a completion
token's async_result specialisation must still provide the nested
typedef `return_type`.
2019-10-30 19:14:00 +11:00
Christopher Kohlhoff
d830b433a8 Add automatic return type deduction to async_initiate.
Enabled for C++11 or later.
2019-10-30 19:14:00 +11:00
Christopher Kohlhoff
62aea6b207 asio version 1.14.1 released 2019-08-19 20:45:13 +10:00
Christopher Kohlhoff
0a52abce85 Regenerate documentation. 2019-08-19 19:42:22 +10:00
Christopher Kohlhoff
855e80ac6a Revision history. 2019-08-19 19:42:22 +10:00
Christopher Kohlhoff
b07229ca0a Require C++17 or later for coroutines TS support with clang. 2019-07-09 12:47:22 +10:00
Christopher Kohlhoff
8861491975 Ensure BOOST_VERSION tests are conditional. 2019-07-09 12:40:44 +10:00
Mike Pollard
772f53a8d8 Added wolfSSL Compatability for Asio 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
2ec993db21 Move shutdown() implementation to winrt_ssocket_service to avoid name hiding. 2019-07-09 09:55:43 +10:00
Torkel Bjørnson-Langen
d21da17f15 Minor fix in documentation for is_dynamic_buffer 2019-07-09 09:55:43 +10:00
Zoltán Mizsei
ebb5d76a24 Preliminary Haiku support 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
a4a7335250 Serial port get_option() should be const. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
6cec63e8a6 Fix warnings about incompatible pointer cast when obtaining CancelIoEx entry point. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
734e339d3f Fix is_*_buffer_sequence detection for user-defined sequence types. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
d2804e5121 Set defaults when opening a serial port on Windows. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
6b53692806 Fix doxygen generation in tutorial. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
ebefe37003 Annotate case fall-through in connect() implementation. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
e03aca35f1 Eliminate a redundant move construction when completed handlers are dispatched. 2019-07-09 09:55:43 +10:00
Christopher Kohlhoff
8d4c8c3ce4 asio version 1.14.0 released 2019-07-09 09:55:21 +10:00