12 Commits

Author SHA1 Message Date
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Christopher Kohlhoff
c36d3ef338 Update copyright notices. 2024-03-05 07:51:17 +11:00
Christopher Kohlhoff
dc3eb7c1aa Migrate remaining c++03 examples to c++11. 2023-12-07 00:23:31 +11:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
488ff8b582 Update C++11 timeouts example to use new form of async_result. 2022-07-05 20:25:57 +10:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
723982b867 Update copyright notices. 2021-02-25 08:29:05 +11:00
Christopher Kohlhoff
e4877fe03d Use properties to obtain an executor's execution context.
Rather than using a context() member function, query the executor's
execution::context_t property to obtain its associated execution
context:

    asio::execution_context& context
      = asio::query(my_io_executor, asio::execution::context);
2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
4b552cfd5b Update copyright notices. 2020-04-07 11:15:42 +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
a25822b74c Add C++11 versions of timeouts examples. 2018-12-05 13:34:20 +11:00