2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-23 14:02:13 +00:00
Commit Graph

1757 Commits

Author SHA1 Message Date
Christopher Kohlhoff
3329cbe225 Fix move operator= for stream_core. 2022-03-02 21:57:42 +11:00
Christopher Kohlhoff
67a7e6b5c1 Fix missing reference to sender_endpoint in io_uring_socket_recvfrom_op. 2022-03-02 21:57:42 +11:00
Christopher Kohlhoff
5cc78465eb Fixed detail::has_allocator_type<T> not matching T::allocator_type 2022-03-02 21:57:41 +11:00
Christopher Kohlhoff
3cd04eee90 Add bind_allocator. 2022-03-02 21:57:41 +11:00
Christopher Kohlhoff
9eb306115d Include detail/concurrency_hint.hpp from io_context.hpp. 2022-03-02 21:24:32 +11:00
Christopher Kohlhoff
e1ba125248 Fix 'zero as null pointer constant' warning. 2022-03-02 21:24:15 +11:00
Christopher Kohlhoff
20ed628d43 Fix associator specialisations for append and prepend. 2022-03-02 21:24:01 +11:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
3966a24bae Version bump. 2021-12-02 10:02:56 +11:00
Christopher Kohlhoff
2257543bb6 Revision history. 2021-12-02 10:02:47 +11:00
Christopher Kohlhoff
9e6b1e18a5 Link to channels example from documentation. 2021-12-02 10:02:47 +11:00
Christopher Kohlhoff
44eb830ee1 Fix awaitable move operator return value. 2021-12-02 08:55:47 +11:00
Christopher Kohlhoff
c95ce94d39 Make awaitable_operators.hpp self contained
It was missing `asio/co_spawn.hpp`
2021-12-02 08:54:38 +11:00
Christopher Kohlhoff
a493ddf11b Use default 'new' alignment, if available.
Fixes an access violation when using coroutines with MSVC and x64
targets, due to misaligned coroutine frames.
2021-12-01 00:07:45 +11:00
Christopher Kohlhoff
723a72bfc9 Eliminate shared_ptr from coro co_spawn() implementation. 2021-12-01 00:07:15 +11:00
Christopher Kohlhoff
0d807a8c47 Prevent async_resume from being called on coro temporaries. 2021-12-01 00:06:47 +11:00
Christopher Kohlhoff
5b81086626 Regenerate documentation. 2021-11-17 08:58:13 +11:00
Christopher Kohlhoff
a4af0eac25 Fix any_io_executor with BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT.
Commit 98f58ee has overlooked the case of `any_io_executor` being a
typedef to `executor` (when `BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT` is
defined) instead of a proper class, resulting in compilation errors.
2021-11-17 08:42:36 +11:00
Christopher Kohlhoff
842ca6e3e5 Work around header inclusion order problem when io_uring is enabled. 2021-11-17 08:42:18 +11:00
Christopher Kohlhoff
ab630c73d1 Fix shutdown cleanup issue in experimental::parallel_group. 2021-11-17 08:42:06 +11:00
Christopher Kohlhoff
da52edb30f Add overview documentation for error handling with C++20 coroutines. 2021-11-17 08:41:51 +11:00
Christopher Kohlhoff
952eb39254 Clean up coro overview. 2021-11-17 08:41:29 +11:00
Christopher Kohlhoff
08e0d07593 Ensure BOOST_ASIO_EXECUTION_EXECUTOR macro does not appear in generated docs. 2021-11-17 08:41:09 +11:00
Christopher Kohlhoff
25f89c77e5 Add clarifications to concurrency hint documentation. 2021-11-17 08:40:07 +11:00
Christopher Kohlhoff
e50201f38d Add missing move assignment operator to awaitable<>. 2021-11-17 08:39:36 +11:00
Christopher Kohlhoff
3cf596f0b2 Regenerate certificates for ssl examples. 2021-11-17 08:39:22 +11:00
Christopher Kohlhoff
59dde8e8ea Fix bind_executor so that it doesn't require a token to provide legacy async_result support. 2021-11-17 08:38:11 +11:00
Christopher Kohlhoff
6f061b94c6 Include library and function in ssl error strings. 2021-11-17 08:37:44 +11:00
Christopher Kohlhoff
d5f201b5d4 Fully qualify use of asio::error namespace. 2021-11-17 08:37:27 +11:00
Christopher Kohlhoff
b428c745b9 Add channel-based proxy example. 2021-11-17 08:37:08 +11:00
Christopher Kohlhoff
8da75d0109 Fix linked list corruption in channel cancel/close handling. 2021-11-17 08:36:03 +11:00
Christopher Kohlhoff
6921e4c65c Add missing destructors. 2021-11-17 08:35:52 +11:00
Christopher Kohlhoff
50fae62f36 Revision history. 2021-11-04 11:15:22 +11:00
Christopher Kohlhoff
1f379847de Version bump. 2021-11-04 02:00:17 +11:00
Christopher Kohlhoff
9e2444320d Regenerate documentation. 2021-11-04 01:58:49 +11:00
Christopher Kohlhoff
495e6367af Add experimental support for channels.
This adds experimental::channel and experimental::concurrent_channel.
Channels may be used to send completions as messages. For example:

  // Create a channel with no buffer space.
  channel<void(error_code, size_t)> ch(ctx);

  // The call to try_send fails as there is no buffer
  // space and no waiting receive operations.
  bool ok = ch.try_send(asio::error::eof, 123);
  assert(!ok);

  // The async_send operation blocks until a receive
  // operation consumes the message.
  ch.async_send(asio::error::eof, 123,
      [](error_code ec)
      {
        // ...
      });

  // The async_receive consumes the message. Both the
  // async_send and async_receive operations complete
  // immediately.
  ch.async_receive(
      [](error_code ec, size_t n)
      {
        // ...
      });
2021-11-04 01:56:32 +11:00
Christopher Kohlhoff
f6d7f83065 Fix clang-11 compile error when io_uring is enabled. 2021-11-04 01:47:40 +11:00
Christopher Kohlhoff
5b72b72b72 Improvements to asio::experimental::coro.
* Added overload so member functions can provide an explicit executor.
* Added co_spawn for coro tasks.
* Added reference and overview documentation.
* Adopted awaitable cancellation model.
* Refactored implementation.
2021-11-04 01:41:25 +11:00
Christopher Kohlhoff
d6d69d87bb Disable aligned_alloc on clang when using MSVC runtime. 2021-11-04 01:35:42 +11:00
Christopher Kohlhoff
46c729aa28 Use faster implementation for network_v4::canonical(). 2021-11-04 01:35:30 +11:00
Christopher Kohlhoff
c1a0c6a124 Fix gcc shadow warnings. 2021-11-04 01:35:20 +11:00
Christopher Kohlhoff
12deb90e5f Remove spurious include. 2021-11-04 01:35:04 +11:00
Christopher Kohlhoff
5a706991b5 Add missing file synchronisation functions. 2021-11-04 01:34:52 +11:00
Ed Catmur
8ca7d080bd Add dependency on Boost::align.
It is required on Windows (from boost/asio/detail/memory.hpp), since
MSVC doesn't have std::aligned_alloc.
2021-11-01 21:19:46 +11:00
Christopher Kohlhoff
76701672f7 Regenerate documentation. 2021-10-29 20:56:28 +11:00
Christopher Kohlhoff
d8359719e1 Add support for registered buffers.
The mutable_registered_buffer and const_registered_buffer classes are
buffer sequence types that represented registered buffers. These buffers
are obtained by first performing a buffer registration:

  auto my_registration =
    asio::register_buffers(
        my_execution_context,
        my_buffer_sequence);

The registration object must be maintained for as long as the buffer
registration is required. The supplied buffer sequence represents the
memory location or locations that will be registered, and the caller
must ensure they remain valid for as long as they are registered. The
registration is automatically removed when the registration object is
destroyed. There can be at most one active registration per execution
context.

The registration object is a container of registered buffers. Buffers
may be obtained from it by iterating over the container, or via direct
index access:

  asio::mutable_registered_buffer my_buffer
    = my_registration[i];

The registered buffers may then be passed directly to operations:

  asio::async_read(my_socket, my_buffer,
      [](error_code ec, size_t n)
      {
        // ...
      });

Buffer registration supports the io_uring backend when used with read
and write operations on descriptors, files, pipes, and sockets.
2021-10-29 20:54:56 +11:00
Christopher Kohlhoff
55eb04e646 Enable io_uring backend for pipes. 2021-10-29 20:51:06 +11:00
Christopher Kohlhoff
d81275f402 Only use io_uring for sockets if it's the default backend. 2021-10-29 20:50:49 +11:00
Christopher Kohlhoff
64fff52244 Only use io_uring for descriptors if it's the default backend. 2021-10-29 20:50:25 +11:00
Christopher Kohlhoff
eed9f6e50b Regenerate documentation. 2021-10-27 13:52:49 +11:00