From 03f3fa07f12201e94d5dcac87002ad94b992df01 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:37:18 +1100 Subject: [PATCH 01/22] Fix use of nullptr. --- include/boost/asio/detail/impl/io_uring_service.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/asio/detail/impl/io_uring_service.ipp b/include/boost/asio/detail/impl/io_uring_service.ipp index 6a9ba5c404..b47344d21b 100644 --- a/include/boost/asio/detail/impl/io_uring_service.ipp +++ b/include/boost/asio/detail/impl/io_uring_service.ipp @@ -689,7 +689,7 @@ __kernel_timespec io_uring_service::get_timeout() const } if (sqe) { - ::io_uring_sqe_set_data(sqe, nullptr); + ::io_uring_sqe_set_data(sqe, 0); ++pending_sqes_; } return sqe; From 730441dcbbfaad73dda87e77395441f0744047a9 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:37:39 +1100 Subject: [PATCH 02/22] Ensure buffered messages can still be received when channel is closed. --- .../detail/impl/channel_service.hpp | 3 +- test/experimental/channel.cpp | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/boost/asio/experimental/detail/impl/channel_service.hpp b/include/boost/asio/experimental/detail/impl/channel_service.hpp index 5eb9761ece..3d9a75db06 100644 --- a/include/boost/asio/experimental/detail/impl/channel_service.hpp +++ b/include/boost/asio/experimental/detail/impl/channel_service.hpp @@ -212,7 +212,8 @@ void channel_service::close( } impl.send_state_ = closed; - impl.receive_state_ = closed; + if (impl.receive_state_ != buffer) + impl.receive_state_ = closed; } template diff --git a/test/experimental/channel.cpp b/test/experimental/channel.cpp index 9e02fec8ca..a0722ea991 100644 --- a/test/experimental/channel.cpp +++ b/test/experimental/channel.cpp @@ -155,6 +155,42 @@ void buffered_channel_test() ctx.run(); BOOST_ASIO_CHECK(!ec2); + + bool b6 = ch1.try_send(boost::system::error_code(), "goodbye"); + + BOOST_ASIO_CHECK(b6); + + ch1.close(); + + boost::system::error_code ec4; + std::string s5; + ch1.async_receive( + [&](boost::system::error_code ec, std::string s) + { + ec4 = ec; + s5 = std::move(s); + }); + + ctx.restart(); + ctx.run(); + + BOOST_ASIO_CHECK(!ec4); + BOOST_ASIO_CHECK(s5 == "goodbye"); + + boost::system::error_code ec5; + std::string s6; + ch1.async_receive( + [&](boost::system::error_code ec, std::string s) + { + ec5 = ec; + s6 = std::move(s); + }); + + ctx.restart(); + ctx.run(); + + BOOST_ASIO_CHECK(ec5 == boost::asio::experimental::channel_errc::channel_closed); + BOOST_ASIO_CHECK(s6.empty()); }; void buffered_error_channel_test() From d8e52891d4fe57f846118403091b9051c3c7ab56 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:37:56 +1100 Subject: [PATCH 03/22] Fix any_completion_handler assignment operator. --- include/boost/asio/any_completion_handler.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/asio/any_completion_handler.hpp b/include/boost/asio/any_completion_handler.hpp index f5ee378bb2..0d3d6683b7 100644 --- a/include/boost/asio/any_completion_handler.hpp +++ b/include/boost/asio/any_completion_handler.hpp @@ -580,7 +580,8 @@ class any_completion_handler any_completion_handler& operator=( any_completion_handler&& other) BOOST_ASIO_NOEXCEPT { - any_completion_handler(other).swap(*this); + any_completion_handler( + BOOST_ASIO_MOVE_CAST(any_completion_handler)(other)).swap(*this); return *this; } From 7f2743e0d11bd88af18e60a2e2899a01feffbb77 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:38:10 +1100 Subject: [PATCH 04/22] Prevent accidental copying of any_completion_handler. --- include/boost/asio/any_completion_handler.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/asio/any_completion_handler.hpp b/include/boost/asio/any_completion_handler.hpp index 0d3d6683b7..ba5b542486 100644 --- a/include/boost/asio/any_completion_handler.hpp +++ b/include/boost/asio/any_completion_handler.hpp @@ -560,7 +560,10 @@ class any_completion_handler } template ::type> - any_completion_handler(H&& h) + any_completion_handler(H&& h, + typename constraint< + !is_same::type, any_completion_handler>::value + >::type = 0) : fn_table_( &detail::any_completion_handler_fn_table_instance< Handler, Signatures...>::value), From 5f39737f5ac1944722dbb422e3b8094bc58b34d4 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:38:31 +1100 Subject: [PATCH 05/22] Suppress spurious 'potential null dereference' warnings. --- .../boost/asio/detail/blocking_executor_op.hpp | 1 + include/boost/asio/detail/bulk_executor_op.hpp | 1 + include/boost/asio/detail/config.hpp | 14 ++++++++++++++ .../boost/asio/detail/descriptor_read_op.hpp | 3 +++ .../boost/asio/detail/descriptor_write_op.hpp | 3 +++ include/boost/asio/detail/executor_op.hpp | 1 + include/boost/asio/detail/impl/scheduler.ipp | 1 + .../detail/io_uring_descriptor_read_at_op.hpp | 3 +++ .../asio/detail/io_uring_descriptor_read_op.hpp | 3 +++ .../detail/io_uring_descriptor_write_at_op.hpp | 3 +++ .../detail/io_uring_descriptor_write_op.hpp | 3 +++ .../asio/detail/io_uring_null_buffers_op.hpp | 2 ++ .../asio/detail/io_uring_socket_accept_op.hpp | 4 ++++ .../asio/detail/io_uring_socket_connect_op.hpp | 2 ++ .../asio/detail/io_uring_socket_recv_op.hpp | 3 +++ .../asio/detail/io_uring_socket_recvfrom_op.hpp | 3 +++ .../asio/detail/io_uring_socket_recvmsg_op.hpp | 3 +++ .../asio/detail/io_uring_socket_send_op.hpp | 3 +++ .../asio/detail/io_uring_socket_sendto_op.hpp | 3 +++ include/boost/asio/detail/io_uring_wait_op.hpp | 2 ++ .../asio/detail/reactive_null_buffers_op.hpp | 2 ++ .../asio/detail/reactive_socket_accept_op.hpp | 5 +++++ .../asio/detail/reactive_socket_connect_op.hpp | 3 +++ .../asio/detail/reactive_socket_recv_op.hpp | 3 +++ .../asio/detail/reactive_socket_recvfrom_op.hpp | 3 +++ .../asio/detail/reactive_socket_recvmsg_op.hpp | 3 +++ .../asio/detail/reactive_socket_send_op.hpp | 3 +++ .../asio/detail/reactive_socket_sendto_op.hpp | 3 +++ include/boost/asio/detail/reactive_wait_op.hpp | 2 ++ .../boost/asio/detail/resolve_endpoint_op.hpp | 1 + include/boost/asio/detail/resolve_query_op.hpp | 1 + .../asio/detail/win_iocp_handle_read_op.hpp | 1 + .../asio/detail/win_iocp_handle_write_op.hpp | 1 + .../asio/detail/win_iocp_null_buffers_op.hpp | 1 + .../asio/detail/win_iocp_overlapped_op.hpp | 1 + .../asio/detail/win_iocp_socket_accept_op.hpp | 2 ++ .../asio/detail/win_iocp_socket_connect_op.hpp | 2 ++ .../asio/detail/win_iocp_socket_recv_op.hpp | 1 + .../asio/detail/win_iocp_socket_recvfrom_op.hpp | 1 + .../asio/detail/win_iocp_socket_recvmsg_op.hpp | 1 + .../asio/detail/win_iocp_socket_send_op.hpp | 1 + include/boost/asio/detail/win_iocp_wait_op.hpp | 1 + include/boost/asio/detail/winrt_resolve_op.hpp | 1 + .../asio/detail/winrt_socket_connect_op.hpp | 1 + .../boost/asio/detail/winrt_socket_recv_op.hpp | 1 + .../boost/asio/detail/winrt_socket_send_op.hpp | 1 + include/boost/asio/execution/any_executor.hpp | 17 ++++++++++++----- 47 files changed, 119 insertions(+), 5 deletions(-) diff --git a/include/boost/asio/detail/blocking_executor_op.hpp b/include/boost/asio/detail/blocking_executor_op.hpp index 96738f2df4..92cda4a9b2 100644 --- a/include/boost/asio/detail/blocking_executor_op.hpp +++ b/include/boost/asio/detail/blocking_executor_op.hpp @@ -78,6 +78,7 @@ class blocking_executor_op : public blocking_executor_op_base const boost::system::error_code& /*ec*/, std::size_t /*bytes_transferred*/) { + BOOST_ASIO_ASSUME(base != 0); blocking_executor_op* o(static_cast(base)); typename blocking_executor_op_base::do_complete_cleanup diff --git a/include/boost/asio/detail/bulk_executor_op.hpp b/include/boost/asio/detail/bulk_executor_op.hpp index c559854153..099acfe64b 100644 --- a/include/boost/asio/detail/bulk_executor_op.hpp +++ b/include/boost/asio/detail/bulk_executor_op.hpp @@ -50,6 +50,7 @@ class bulk_executor_op : public Operation std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); bulk_executor_op* o(static_cast(base)); Alloc allocator(o->allocator_); ptr p = { detail::addressof(allocator), o, o }; diff --git a/include/boost/asio/detail/config.hpp b/include/boost/asio/detail/config.hpp index c90e9b5683..0ff7f58a6f 100644 --- a/include/boost/asio/detail/config.hpp +++ b/include/boost/asio/detail/config.hpp @@ -2091,6 +2091,20 @@ # define BOOST_ASIO_UNUSED_VARIABLE #endif // !defined(BOOST_ASIO_UNUSED_VARIABLE) +// Helper macro to tell the optimiser what may be assumed to be true. +#if defined(BOOST_ASIO_MSVC) +# define BOOST_ASIO_ASSUME(expr) __assume(expr) +#elif defined(__clang__) +# if __has_builtin(__builtin_assume) +# define BOOST_ASIO_ASSUME(expr) __builtin_assume(expr) +# endif // __has_builtin(__builtin_assume) +#elif defined(__GNUC__) +# define BOOST_ASIO_ASSUME(expr) if (expr) {} else { __builtin_unreachable(); } +#endif // defined(__GNUC__) +#if !defined(BOOST_ASIO_ASSUME) +# define BOOST_ASIO_ASSUME (void)0 +#endif // !defined(BOOST_ASIO_ASSUME) + // Support the co_await keyword on compilers known to allow it. #if !defined(BOOST_ASIO_HAS_CO_AWAIT) # if !defined(BOOST_ASIO_DISABLE_CO_AWAIT) diff --git a/include/boost/asio/detail/descriptor_read_op.hpp b/include/boost/asio/detail/descriptor_read_op.hpp index dd3d15cae0..610532331a 100644 --- a/include/boost/asio/detail/descriptor_read_op.hpp +++ b/include/boost/asio/detail/descriptor_read_op.hpp @@ -50,6 +50,7 @@ class descriptor_read_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); descriptor_read_op_base* o(static_cast(base)); typedef buffer_sequence_adapter(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -143,6 +145,7 @@ class descriptor_read_op static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); descriptor_read_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/descriptor_write_op.hpp b/include/boost/asio/detail/descriptor_write_op.hpp index 6e9efdbbce..344dc7b311 100644 --- a/include/boost/asio/detail/descriptor_write_op.hpp +++ b/include/boost/asio/detail/descriptor_write_op.hpp @@ -49,6 +49,7 @@ class descriptor_write_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); descriptor_write_op_base* o(static_cast(base)); typedef buffer_sequence_adapter(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -142,6 +144,7 @@ class descriptor_write_op static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); descriptor_write_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/executor_op.hpp b/include/boost/asio/detail/executor_op.hpp index 1a01fff109..a94ee679f4 100644 --- a/include/boost/asio/detail/executor_op.hpp +++ b/include/boost/asio/detail/executor_op.hpp @@ -47,6 +47,7 @@ class executor_op : public Operation std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); executor_op* o(static_cast(base)); Alloc allocator(o->allocator_); ptr p = { detail::addressof(allocator), o, o }; diff --git a/include/boost/asio/detail/impl/scheduler.ipp b/include/boost/asio/detail/impl/scheduler.ipp index 70a952e7bd..28f34dddc9 100644 --- a/include/boost/asio/detail/impl/scheduler.ipp +++ b/include/boost/asio/detail/impl/scheduler.ipp @@ -328,6 +328,7 @@ void scheduler::restart() void scheduler::compensating_work_started() { thread_info_base* this_thread = thread_call_stack::contains(this); + BOOST_ASIO_ASSUME(this_thread != 0); // Only called from inside scheduler. ++static_cast(this_thread)->private_outstanding_work; } diff --git a/include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp b/include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp index f0f736f698..04c9e4f197 100644 --- a/include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp +++ b/include/boost/asio/detail/io_uring_descriptor_read_at_op.hpp @@ -55,6 +55,7 @@ class io_uring_descriptor_read_at_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_at_op_base* o( static_cast(base)); @@ -77,6 +78,7 @@ class io_uring_descriptor_read_at_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_at_op_base* o( static_cast(base)); @@ -144,6 +146,7 @@ class io_uring_descriptor_read_at_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_at_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_descriptor_read_op.hpp b/include/boost/asio/detail/io_uring_descriptor_read_op.hpp index 3b5fb8f8d7..2457541147 100644 --- a/include/boost/asio/detail/io_uring_descriptor_read_op.hpp +++ b/include/boost/asio/detail/io_uring_descriptor_read_op.hpp @@ -52,6 +52,7 @@ class io_uring_descriptor_read_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_op_base* o( static_cast(base)); @@ -74,6 +75,7 @@ class io_uring_descriptor_read_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_op_base* o( static_cast(base)); @@ -139,6 +141,7 @@ class io_uring_descriptor_read_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_read_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_descriptor_write_at_op.hpp b/include/boost/asio/detail/io_uring_descriptor_write_at_op.hpp index f99d82527f..3cf22040fc 100644 --- a/include/boost/asio/detail/io_uring_descriptor_write_at_op.hpp +++ b/include/boost/asio/detail/io_uring_descriptor_write_at_op.hpp @@ -54,6 +54,7 @@ class io_uring_descriptor_write_at_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_at_op_base* o( static_cast(base)); @@ -76,6 +77,7 @@ class io_uring_descriptor_write_at_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_at_op_base* o( static_cast(base)); @@ -138,6 +140,7 @@ class io_uring_descriptor_write_at_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_at_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_descriptor_write_op.hpp b/include/boost/asio/detail/io_uring_descriptor_write_op.hpp index d797235700..1bd7d4a0cb 100644 --- a/include/boost/asio/detail/io_uring_descriptor_write_op.hpp +++ b/include/boost/asio/detail/io_uring_descriptor_write_op.hpp @@ -52,6 +52,7 @@ class io_uring_descriptor_write_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_op_base* o( static_cast(base)); @@ -74,6 +75,7 @@ class io_uring_descriptor_write_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_op_base* o( static_cast(base)); @@ -134,6 +136,7 @@ class io_uring_descriptor_write_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_descriptor_write_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_null_buffers_op.hpp b/include/boost/asio/detail/io_uring_null_buffers_op.hpp index 5c3c88d2b8..1d9ebbfbf3 100644 --- a/include/boost/asio/detail/io_uring_null_buffers_op.hpp +++ b/include/boost/asio/detail/io_uring_null_buffers_op.hpp @@ -51,6 +51,7 @@ class io_uring_null_buffers_op : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_null_buffers_op* o(static_cast(base)); ::io_uring_prep_poll_add(sqe, o->descriptor_, o->poll_flags_); @@ -66,6 +67,7 @@ class io_uring_null_buffers_op : public io_uring_operation std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_null_buffers_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_accept_op.hpp b/include/boost/asio/detail/io_uring_socket_accept_op.hpp index 659260a7f2..cffcf8255b 100644 --- a/include/boost/asio/detail/io_uring_socket_accept_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_accept_op.hpp @@ -57,6 +57,7 @@ class io_uring_socket_accept_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_accept_op_base* o( static_cast(base)); @@ -74,6 +75,7 @@ class io_uring_socket_accept_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_accept_op_base* o( static_cast(base)); @@ -148,6 +150,7 @@ class io_uring_socket_accept_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_accept_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -222,6 +225,7 @@ class io_uring_socket_move_accept_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_move_accept_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_connect_op.hpp b/include/boost/asio/detail/io_uring_socket_connect_op.hpp index a9ecb9b146..37c946ca25 100644 --- a/include/boost/asio/detail/io_uring_socket_connect_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_connect_op.hpp @@ -51,6 +51,7 @@ class io_uring_socket_connect_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_connect_op_base* o( static_cast(base)); @@ -91,6 +92,7 @@ class io_uring_socket_connect_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_connect_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_recv_op.hpp b/include/boost/asio/detail/io_uring_socket_recv_op.hpp index 9bd7fc11dd..eb437856de 100644 --- a/include/boost/asio/detail/io_uring_socket_recv_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_recv_op.hpp @@ -57,6 +57,7 @@ class io_uring_socket_recv_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recv_op_base* o( static_cast(base)); @@ -80,6 +81,7 @@ class io_uring_socket_recv_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recv_op_base* o( static_cast(base)); @@ -154,6 +156,7 @@ class io_uring_socket_recv_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recv_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_recvfrom_op.hpp b/include/boost/asio/detail/io_uring_socket_recvfrom_op.hpp index f2af13c2fb..67aa18bfbc 100644 --- a/include/boost/asio/detail/io_uring_socket_recvfrom_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_recvfrom_op.hpp @@ -61,6 +61,7 @@ class io_uring_socket_recvfrom_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvfrom_op_base* o( static_cast(base)); @@ -77,6 +78,7 @@ class io_uring_socket_recvfrom_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvfrom_op_base* o( static_cast(base)); @@ -155,6 +157,7 @@ class io_uring_socket_recvfrom_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvfrom_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_recvmsg_op.hpp b/include/boost/asio/detail/io_uring_socket_recvmsg_op.hpp index 459bdf8ebf..49c58fdda6 100644 --- a/include/boost/asio/detail/io_uring_socket_recvmsg_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_recvmsg_op.hpp @@ -58,6 +58,7 @@ class io_uring_socket_recvmsg_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvmsg_op_base* o( static_cast(base)); @@ -74,6 +75,7 @@ class io_uring_socket_recvmsg_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvmsg_op_base* o( static_cast(base)); @@ -141,6 +143,7 @@ class io_uring_socket_recvmsg_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_recvmsg_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_send_op.hpp b/include/boost/asio/detail/io_uring_socket_send_op.hpp index 2a2eaeca61..e0d2756c3c 100644 --- a/include/boost/asio/detail/io_uring_socket_send_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_send_op.hpp @@ -57,6 +57,7 @@ class io_uring_socket_send_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_send_op_base* o( static_cast(base)); @@ -79,6 +80,7 @@ class io_uring_socket_send_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_send_op_base* o( static_cast(base)); @@ -140,6 +142,7 @@ class io_uring_socket_send_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_send_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_socket_sendto_op.hpp b/include/boost/asio/detail/io_uring_socket_sendto_op.hpp index 58e61b4ae3..cb1d98e69c 100644 --- a/include/boost/asio/detail/io_uring_socket_sendto_op.hpp +++ b/include/boost/asio/detail/io_uring_socket_sendto_op.hpp @@ -61,6 +61,7 @@ class io_uring_socket_sendto_op_base : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_sendto_op_base* o( static_cast(base)); @@ -76,6 +77,7 @@ class io_uring_socket_sendto_op_base : public io_uring_operation static bool do_perform(io_uring_operation* base, bool after_completion) { + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_sendto_op_base* o( static_cast(base)); @@ -143,6 +145,7 @@ class io_uring_socket_sendto_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_socket_sendto_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/io_uring_wait_op.hpp b/include/boost/asio/detail/io_uring_wait_op.hpp index e77c0879b2..bf1a9efb3c 100644 --- a/include/boost/asio/detail/io_uring_wait_op.hpp +++ b/include/boost/asio/detail/io_uring_wait_op.hpp @@ -49,6 +49,7 @@ class io_uring_wait_op : public io_uring_operation static void do_prepare(io_uring_operation* base, ::io_uring_sqe* sqe) { + BOOST_ASIO_ASSUME(base != 0); io_uring_wait_op* o(static_cast(base)); ::io_uring_prep_poll_add(sqe, o->descriptor_, o->poll_flags_); @@ -64,6 +65,7 @@ class io_uring_wait_op : public io_uring_operation std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); io_uring_wait_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_null_buffers_op.hpp b/include/boost/asio/detail/reactive_null_buffers_op.hpp index 0773d74ad4..23824b8697 100644 --- a/include/boost/asio/detail/reactive_null_buffers_op.hpp +++ b/include/boost/asio/detail/reactive_null_buffers_op.hpp @@ -58,6 +58,7 @@ class reactive_null_buffers_op : public reactor_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_null_buffers_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -92,6 +93,7 @@ class reactive_null_buffers_op : public reactor_op static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_null_buffers_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_accept_op.hpp b/include/boost/asio/detail/reactive_socket_accept_op.hpp index d42322ebf0..043ea09668 100644 --- a/include/boost/asio/detail/reactive_socket_accept_op.hpp +++ b/include/boost/asio/detail/reactive_socket_accept_op.hpp @@ -53,6 +53,7 @@ class reactive_socket_accept_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_accept_op_base* o( static_cast(base)); @@ -118,6 +119,7 @@ class reactive_socket_accept_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_accept_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -158,6 +160,7 @@ class reactive_socket_accept_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_accept_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -229,6 +232,7 @@ class reactive_socket_move_accept_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_move_accept_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -272,6 +276,7 @@ class reactive_socket_move_accept_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_move_accept_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_connect_op.hpp b/include/boost/asio/detail/reactive_socket_connect_op.hpp index 7349aafed1..61cbfd54b5 100644 --- a/include/boost/asio/detail/reactive_socket_connect_op.hpp +++ b/include/boost/asio/detail/reactive_socket_connect_op.hpp @@ -44,6 +44,7 @@ class reactive_socket_connect_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_connect_op_base* o( static_cast(base)); @@ -82,6 +83,7 @@ class reactive_socket_connect_op : public reactive_socket_connect_op_base std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_connect_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -119,6 +121,7 @@ class reactive_socket_connect_op : public reactive_socket_connect_op_base static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_connect_op* o (static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_recv_op.hpp b/include/boost/asio/detail/reactive_socket_recv_op.hpp index 200748310a..23fb55293a 100644 --- a/include/boost/asio/detail/reactive_socket_recv_op.hpp +++ b/include/boost/asio/detail/reactive_socket_recv_op.hpp @@ -51,6 +51,7 @@ class reactive_socket_recv_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recv_op_base* o( static_cast(base)); @@ -119,6 +120,7 @@ class reactive_socket_recv_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recv_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -155,6 +157,7 @@ class reactive_socket_recv_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recv_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_recvfrom_op.hpp b/include/boost/asio/detail/reactive_socket_recvfrom_op.hpp index 998440ea2a..a62e640563 100644 --- a/include/boost/asio/detail/reactive_socket_recvfrom_op.hpp +++ b/include/boost/asio/detail/reactive_socket_recvfrom_op.hpp @@ -52,6 +52,7 @@ class reactive_socket_recvfrom_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvfrom_op_base* o( static_cast(base)); @@ -123,6 +124,7 @@ class reactive_socket_recvfrom_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvfrom_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -160,6 +162,7 @@ class reactive_socket_recvfrom_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvfrom_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_recvmsg_op.hpp b/include/boost/asio/detail/reactive_socket_recvmsg_op.hpp index 89232b8b7b..040d900c4b 100644 --- a/include/boost/asio/detail/reactive_socket_recvmsg_op.hpp +++ b/include/boost/asio/detail/reactive_socket_recvmsg_op.hpp @@ -52,6 +52,7 @@ class reactive_socket_recvmsg_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvmsg_op_base* o( static_cast(base)); @@ -104,6 +105,7 @@ class reactive_socket_recvmsg_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvmsg_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -141,6 +143,7 @@ class reactive_socket_recvmsg_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_recvmsg_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_send_op.hpp b/include/boost/asio/detail/reactive_socket_send_op.hpp index df46b5a1c0..891531b82d 100644 --- a/include/boost/asio/detail/reactive_socket_send_op.hpp +++ b/include/boost/asio/detail/reactive_socket_send_op.hpp @@ -51,6 +51,7 @@ class reactive_socket_send_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_send_op_base* o( static_cast(base)); @@ -122,6 +123,7 @@ class reactive_socket_send_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_send_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -158,6 +160,7 @@ class reactive_socket_send_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_send_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_socket_sendto_op.hpp b/include/boost/asio/detail/reactive_socket_sendto_op.hpp index ab0143cad1..de7a2aff5d 100644 --- a/include/boost/asio/detail/reactive_socket_sendto_op.hpp +++ b/include/boost/asio/detail/reactive_socket_sendto_op.hpp @@ -51,6 +51,7 @@ class reactive_socket_sendto_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); reactive_socket_sendto_op_base* o( static_cast(base)); @@ -116,6 +117,7 @@ class reactive_socket_sendto_op : std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_sendto_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -152,6 +154,7 @@ class reactive_socket_sendto_op : static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_socket_sendto_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/reactive_wait_op.hpp b/include/boost/asio/detail/reactive_wait_op.hpp index a9bf01e0b7..a1e843e85e 100644 --- a/include/boost/asio/detail/reactive_wait_op.hpp +++ b/include/boost/asio/detail/reactive_wait_op.hpp @@ -58,6 +58,7 @@ class reactive_wait_op : public reactor_op std::size_t /*bytes_transferred*/) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_wait_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -92,6 +93,7 @@ class reactive_wait_op : public reactor_op static void do_immediate(operation* base, bool, const void* io_ex) { // Take ownership of the handler object. + BOOST_ASIO_ASSUME(base != 0); reactive_wait_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/resolve_endpoint_op.hpp b/include/boost/asio/detail/resolve_endpoint_op.hpp index 628fc8783a..f2e08b9a39 100644 --- a/include/boost/asio/detail/resolve_endpoint_op.hpp +++ b/include/boost/asio/detail/resolve_endpoint_op.hpp @@ -71,6 +71,7 @@ class resolve_endpoint_op : public resolve_op std::size_t /*bytes_transferred*/) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); resolve_endpoint_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/resolve_query_op.hpp b/include/boost/asio/detail/resolve_query_op.hpp index f23e56f061..24807ef87a 100644 --- a/include/boost/asio/detail/resolve_query_op.hpp +++ b/include/boost/asio/detail/resolve_query_op.hpp @@ -79,6 +79,7 @@ class resolve_query_op : public resolve_op std::size_t /*bytes_transferred*/) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); resolve_query_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_handle_read_op.hpp b/include/boost/asio/detail/win_iocp_handle_read_op.hpp index dcffb3c5f2..f0a8116949 100644 --- a/include/boost/asio/detail/win_iocp_handle_read_op.hpp +++ b/include/boost/asio/detail/win_iocp_handle_read_op.hpp @@ -58,6 +58,7 @@ class win_iocp_handle_read_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_handle_read_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_handle_write_op.hpp b/include/boost/asio/detail/win_iocp_handle_write_op.hpp index d5fa5935dd..a9c35b0979 100644 --- a/include/boost/asio/detail/win_iocp_handle_write_op.hpp +++ b/include/boost/asio/detail/win_iocp_handle_write_op.hpp @@ -57,6 +57,7 @@ class win_iocp_handle_write_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_handle_write_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_null_buffers_op.hpp b/include/boost/asio/detail/win_iocp_null_buffers_op.hpp index 05ef9c73c8..9d2f80d753 100644 --- a/include/boost/asio/detail/win_iocp_null_buffers_op.hpp +++ b/include/boost/asio/detail/win_iocp_null_buffers_op.hpp @@ -64,6 +64,7 @@ class win_iocp_null_buffers_op : public reactor_op boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_null_buffers_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_overlapped_op.hpp b/include/boost/asio/detail/win_iocp_overlapped_op.hpp index fbcfbdb360..3bd436fbf7 100644 --- a/include/boost/asio/detail/win_iocp_overlapped_op.hpp +++ b/include/boost/asio/detail/win_iocp_overlapped_op.hpp @@ -53,6 +53,7 @@ class win_iocp_overlapped_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_overlapped_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_accept_op.hpp b/include/boost/asio/detail/win_iocp_socket_accept_op.hpp index b05aab72d5..1c3e351645 100644 --- a/include/boost/asio/detail/win_iocp_socket_accept_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_accept_op.hpp @@ -89,6 +89,7 @@ class win_iocp_socket_accept_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_accept_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; @@ -235,6 +236,7 @@ class win_iocp_socket_move_accept_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_move_accept_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_connect_op.hpp b/include/boost/asio/detail/win_iocp_socket_connect_op.hpp index e3cb68d6ca..5304a4ceed 100644 --- a/include/boost/asio/detail/win_iocp_socket_connect_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_connect_op.hpp @@ -48,6 +48,7 @@ class win_iocp_socket_connect_op_base : public reactor_op static status do_perform(reactor_op* base) { + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_connect_op_base* o( static_cast(base)); @@ -81,6 +82,7 @@ class win_iocp_socket_connect_op : public win_iocp_socket_connect_op_base boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_connect_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_recv_op.hpp b/include/boost/asio/detail/win_iocp_socket_recv_op.hpp index 8f05b0698c..9bfb7cdb10 100644 --- a/include/boost/asio/detail/win_iocp_socket_recv_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_recv_op.hpp @@ -62,6 +62,7 @@ class win_iocp_socket_recv_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_recv_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp b/include/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp index 181e3fd6f6..6d7650b171 100644 --- a/include/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp @@ -69,6 +69,7 @@ class win_iocp_socket_recvfrom_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_recvfrom_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp b/include/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp index 92372666dc..deaa6e66f4 100644 --- a/include/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp @@ -64,6 +64,7 @@ class win_iocp_socket_recvmsg_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_recvmsg_op* o( static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_socket_send_op.hpp b/include/boost/asio/detail/win_iocp_socket_send_op.hpp index 2d807c19bf..1e6cdeee7c 100644 --- a/include/boost/asio/detail/win_iocp_socket_send_op.hpp +++ b/include/boost/asio/detail/win_iocp_socket_send_op.hpp @@ -60,6 +60,7 @@ class win_iocp_socket_send_op : public operation boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_socket_send_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/win_iocp_wait_op.hpp b/include/boost/asio/detail/win_iocp_wait_op.hpp index 0125dd74dc..1773cad066 100644 --- a/include/boost/asio/detail/win_iocp_wait_op.hpp +++ b/include/boost/asio/detail/win_iocp_wait_op.hpp @@ -65,6 +65,7 @@ class win_iocp_wait_op : public reactor_op boost::system::error_code ec(result_ec); // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); win_iocp_wait_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/winrt_resolve_op.hpp b/include/boost/asio/detail/winrt_resolve_op.hpp index 8de6dd7f91..f8d1a18900 100644 --- a/include/boost/asio/detail/winrt_resolve_op.hpp +++ b/include/boost/asio/detail/winrt_resolve_op.hpp @@ -64,6 +64,7 @@ class winrt_resolve_op : const boost::system::error_code&, std::size_t) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); winrt_resolve_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/winrt_socket_connect_op.hpp b/include/boost/asio/detail/winrt_socket_connect_op.hpp index a0c8fba0da..b198c9e378 100644 --- a/include/boost/asio/detail/winrt_socket_connect_op.hpp +++ b/include/boost/asio/detail/winrt_socket_connect_op.hpp @@ -53,6 +53,7 @@ class winrt_socket_connect_op : const boost::system::error_code&, std::size_t) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); winrt_socket_connect_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/winrt_socket_recv_op.hpp b/include/boost/asio/detail/winrt_socket_recv_op.hpp index af61555885..99b7459c87 100644 --- a/include/boost/asio/detail/winrt_socket_recv_op.hpp +++ b/include/boost/asio/detail/winrt_socket_recv_op.hpp @@ -56,6 +56,7 @@ class winrt_socket_recv_op : const boost::system::error_code&, std::size_t) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); winrt_socket_recv_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/detail/winrt_socket_send_op.hpp b/include/boost/asio/detail/winrt_socket_send_op.hpp index 9079c13a69..913f77e84b 100644 --- a/include/boost/asio/detail/winrt_socket_send_op.hpp +++ b/include/boost/asio/detail/winrt_socket_send_op.hpp @@ -55,6 +55,7 @@ class winrt_socket_send_op : const boost::system::error_code&, std::size_t) { // Take ownership of the operation object. + BOOST_ASIO_ASSUME(base != 0); winrt_socket_send_op* o(static_cast(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; diff --git a/include/boost/asio/execution/any_executor.hpp b/include/boost/asio/execution/any_executor.hpp index 67eb6c4bdb..2514e4c5e6 100644 --- a/include/boost/asio/execution/any_executor.hpp +++ b/include/boost/asio/execution/any_executor.hpp @@ -993,27 +993,34 @@ class any_executor_base static bool equal_ex(const any_executor_base& ex1, const any_executor_base& ex2) { - return *ex1.target() == *ex2.target(); + const Ex* p1 = ex1.target(); + const Ex* p2 = ex2.target(); + BOOST_ASIO_ASSUME(p1 != 0 && p2 != 0); + return *p1 == *p2; } template static void execute_ex(const any_executor_base& ex, BOOST_ASIO_MOVE_ARG(function) f) { + const Ex* p = ex.target(); + BOOST_ASIO_ASSUME(p != 0); #if defined(BOOST_ASIO_NO_DEPRECATED) - ex.target()->execute(BOOST_ASIO_MOVE_CAST(function)(f)); + p->execute(BOOST_ASIO_MOVE_CAST(function)(f)); #else // defined(BOOST_ASIO_NO_DEPRECATED) - execution::execute(*ex.target(), BOOST_ASIO_MOVE_CAST(function)(f)); + execution::execute(*p, BOOST_ASIO_MOVE_CAST(function)(f)); #endif // defined(BOOST_ASIO_NO_DEPRECATED) } template static void blocking_execute_ex(const any_executor_base& ex, function_view f) { + const Ex* p = ex.target(); + BOOST_ASIO_ASSUME(p != 0); #if defined(BOOST_ASIO_NO_DEPRECATED) - ex.target()->execute(f); + p->execute(f); #else // defined(BOOST_ASIO_NO_DEPRECATED) - execution::execute(*ex.target(), f); + execution::execute(*p, f); #endif // defined(BOOST_ASIO_NO_DEPRECATED) } From db1af40f2ba4995ee42aeade975d2bc95c128a97 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:38:46 +1100 Subject: [PATCH 06/22] Fix spurious operator precedence warning with MSVC. --- include/boost/asio/buffer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/asio/buffer.hpp b/include/boost/asio/buffer.hpp index 15ad997c7f..c620ccc876 100644 --- a/include/boost/asio/buffer.hpp +++ b/include/boost/asio/buffer.hpp @@ -2754,9 +2754,9 @@ struct hex_literal, Hi, Lo, Chars...> : static_cast( Lo >= 'A' && Lo <= 'F' ? Lo - 'A' + 10 : (Lo >= 'a' && Lo <= 'f' ? Lo - 'a' + 10 : Lo - '0')) | - (static_cast( + ((static_cast( Hi >= 'A' && Hi <= 'F' ? Hi - 'A' + 10 : - (Hi >= 'a' && Hi <= 'f' ? Hi - 'a' + 10 : Hi - '0')) << 4) + (Hi >= 'a' && Hi <= 'f' ? Hi - 'a' + 10 : Hi - '0'))) << 4) >, Chars...> {}; template From c1269d1c822a9a48167732c936205229793bc5ac Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:38:59 +1100 Subject: [PATCH 07/22] Use uint64_t for OpenSSL options. --- include/boost/asio/ssl/context_base.hpp | 46 ++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/include/boost/asio/ssl/context_base.hpp b/include/boost/asio/ssl/context_base.hpp index 95e4d2efcc..6a418c7b63 100644 --- a/include/boost/asio/ssl/context_base.hpp +++ b/include/boost/asio/ssl/context_base.hpp @@ -106,60 +106,60 @@ class context_base }; /// Bitmask type for SSL options. - typedef long options; + typedef uint64_t options; #if defined(GENERATING_DOCUMENTATION) /// Implement various bug workarounds. - static const long default_workarounds = implementation_defined; + static const uint64_t default_workarounds = implementation_defined; /// Always create a new key when using tmp_dh parameters. - static const long single_dh_use = implementation_defined; + static const uint64_t single_dh_use = implementation_defined; /// Disable SSL v2. - static const long no_sslv2 = implementation_defined; + static const uint64_t no_sslv2 = implementation_defined; /// Disable SSL v3. - static const long no_sslv3 = implementation_defined; + static const uint64_t no_sslv3 = implementation_defined; /// Disable TLS v1. - static const long no_tlsv1 = implementation_defined; + static const uint64_t no_tlsv1 = implementation_defined; /// Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; + static const uint64_t no_tlsv1_1 = implementation_defined; /// Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; + static const uint64_t no_tlsv1_2 = implementation_defined; /// Disable TLS v1.3. - static const long no_tlsv1_3 = implementation_defined; + static const uint64_t no_tlsv1_3 = implementation_defined; /// Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; + static const uint64_t no_compression = implementation_defined; #else - BOOST_ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL); - BOOST_ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE); - BOOST_ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2); - BOOST_ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3); - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, default_workarounds = SSL_OP_ALL); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, single_dh_use = SSL_OP_SINGLE_DH_USE); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_sslv2 = SSL_OP_NO_SSLv2); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_sslv3 = SSL_OP_NO_SSLv3); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1 = SSL_OP_NO_TLSv1); # if defined(SSL_OP_NO_TLSv1_1) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = SSL_OP_NO_TLSv1_1); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = SSL_OP_NO_TLSv1_1); # else // defined(SSL_OP_NO_TLSv1_1) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_1 = 0x10000000L); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = 0x10000000L); # endif // defined(SSL_OP_NO_TLSv1_1) # if defined(SSL_OP_NO_TLSv1_2) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = SSL_OP_NO_TLSv1_2); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = SSL_OP_NO_TLSv1_2); # else // defined(SSL_OP_NO_TLSv1_2) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_2 = 0x08000000L); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = 0x08000000L); # endif // defined(SSL_OP_NO_TLSv1_2) # if defined(SSL_OP_NO_TLSv1_3) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_3 = SSL_OP_NO_TLSv1_3); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = SSL_OP_NO_TLSv1_3); # else // defined(SSL_OP_NO_TLSv1_3) - BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1_3 = 0x20000000L); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = 0x20000000L); # endif // defined(SSL_OP_NO_TLSv1_3) # if defined(SSL_OP_NO_COMPRESSION) - BOOST_ASIO_STATIC_CONSTANT(long, no_compression = SSL_OP_NO_COMPRESSION); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_compression = SSL_OP_NO_COMPRESSION); # else // defined(SSL_OP_NO_COMPRESSION) - BOOST_ASIO_STATIC_CONSTANT(long, no_compression = 0x20000L); + BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_compression = 0x20000L); # endif // defined(SSL_OP_NO_COMPRESSION) #endif From d6cad8835e5587dadd4e8dae77445b800972140d Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:39:17 +1100 Subject: [PATCH 08/22] Expose sigaction() flags via optional argument to signal_set::add. When registering a signal, it is now possible to pass flags that specify the behaviour associated with the signal. These flags are specified as an enum type in a new class, signal_set_base, and are passed to the underlying sigaction() call. For example: asio::signal_set sigs(my_io_context); sigs.add(SIGINT, asio::signal_set::flags::restart); Specifying flags other than flags::dont_care will fail unless sigaction() is supported by the target operating system. Since signal registration is global, conflicting flags (multiple registrations that pass differing flags other than flags::dont_care) will also result in an error. --- include/boost/asio.hpp | 1 + include/boost/asio/basic_signal_set.hpp | 55 +++++- .../asio/detail/impl/signal_set_service.ipp | 57 +++++- .../boost/asio/detail/signal_set_service.hpp | 11 +- include/boost/asio/detail/socket_types.hpp | 4 + include/boost/asio/signal_set_base.hpp | 173 ++++++++++++++++++ test/Jamfile.v2 | 2 + test/signal_set.cpp | 3 + test/signal_set_base.cpp | 30 +++ 9 files changed, 331 insertions(+), 5 deletions(-) create mode 100644 include/boost/asio/signal_set_base.hpp create mode 100644 test/signal_set_base.cpp diff --git a/include/boost/asio.hpp b/include/boost/asio.hpp index 0140f6bc72..1d78a75877 100644 --- a/include/boost/asio.hpp +++ b/include/boost/asio.hpp @@ -181,6 +181,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/asio/basic_signal_set.hpp b/include/boost/asio/basic_signal_set.hpp index 7062cfbb50..c080bdff1a 100644 --- a/include/boost/asio/basic_signal_set.hpp +++ b/include/boost/asio/basic_signal_set.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -94,7 +95,7 @@ namespace asio { * least one thread. */ template -class basic_signal_set +class basic_signal_set : public signal_set_base { private: class initiate_async_wait; @@ -371,6 +372,58 @@ class basic_signal_set BOOST_ASIO_SYNC_OP_VOID_RETURN(ec); } + /// Add a signal to a signal_set with the specified flags. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * Flags other than flags::dont_care require OS support for the @c sigaction + * call, and this function will fail with @c error::operation_not_supported if + * this is unavailable. + * + * The specified flags will conflict with a prior, active registration of the + * same signal, if either specified a flags value other than flags::dont_care. + * In this case, the @c add will fail with @c error::invalid_argument. + * + * @param signal_number The signal to be added to the set. + * + * @param f Flags to modify the behaviour of the specified signal. + * + * @throws boost::system::system_error Thrown on failure. + */ + void add(int signal_number, flags_t f) + { + boost::system::error_code ec; + impl_.get_service().add(impl_.get_implementation(), signal_number, f, ec); + boost::asio::detail::throw_error(ec, "add"); + } + + /// Add a signal to a signal_set with the specified flags. + /** + * This function adds the specified signal to the set. It has no effect if the + * signal is already in the set. + * + * Flags other than flags::dont_care require OS support for the @c sigaction + * call, and this function will fail with @c error::operation_not_supported if + * this is unavailable. + * + * The specified flags will conflict with a prior, active registration of the + * same signal, if either specified a flags value other than flags::dont_care. + * In this case, the @c add will fail with @c error::invalid_argument. + * + * @param signal_number The signal to be added to the set. + * + * @param f Flags to modify the behaviour of the specified signal. + * + * @param ec Set to indicate what error occurred, if any. + */ + BOOST_ASIO_SYNC_OP_VOID add(int signal_number, flags_t f, + boost::system::error_code& ec) + { + impl_.get_service().add(impl_.get_implementation(), signal_number, f, ec); + BOOST_ASIO_SYNC_OP_VOID_RETURN(ec); + } + /// Remove a signal from a signal_set. /** * This function removes the specified signal from the set. It has no effect diff --git a/include/boost/asio/detail/impl/signal_set_service.ipp b/include/boost/asio/detail/impl/signal_set_service.ipp index 943e99f47d..695b688ce6 100644 --- a/include/boost/asio/detail/impl/signal_set_service.ipp +++ b/include/boost/asio/detail/impl/signal_set_service.ipp @@ -55,12 +55,16 @@ struct signal_state // A count of the number of objects that are registered for each signal. std::size_t registration_count_[max_signal_number]; + + // The flags used for each registered signal. + signal_set_base::flags_t flags_[max_signal_number]; }; signal_state* get_signal_state() { static signal_state state = { - BOOST_ASIO_STATIC_MUTEX_INIT, -1, -1, false, 0, { 0 } }; + BOOST_ASIO_STATIC_MUTEX_INIT, -1, -1, false, 0, + { 0 }, { signal_set_base::flags_t() } }; return &state; } @@ -307,8 +311,8 @@ void signal_set_service::destroy( } boost::system::error_code signal_set_service::add( - signal_set_service::implementation_type& impl, - int signal_number, boost::system::error_code& ec) + signal_set_service::implementation_type& impl, int signal_number, + signal_set_base::flags_t f, boost::system::error_code& ec) { // Check that the signal number is valid. if (signal_number < 0 || signal_number >= max_signal_number) @@ -317,6 +321,15 @@ boost::system::error_code signal_set_service::add( return ec; } + // Check that the specified flags are supported. +#if !defined(BOOST_ASIO_HAS_SIGACTION) + if (f != signal_set_base::flags::dont_care) + { + ec = boost::asio::error::operation_not_supported; + return ec; + } +#endif // !defined(BOOST_ASIO_HAS_SIGACTION) + signal_state* state = get_signal_state(); static_mutex::scoped_lock lock(state->mutex_); @@ -344,6 +357,8 @@ boost::system::error_code signal_set_service::add( memset(&sa, 0, sizeof(sa)); sa.sa_handler = boost_asio_signal_handler; sigfillset(&sa.sa_mask); + if (f != signal_set_base::flags::dont_care) + sa.sa_flags = static_cast(f); if (::sigaction(signal_number, &sa, 0) == -1) # else // defined(BOOST_ASIO_HAS_SIGACTION) if (::signal(signal_number, boost_asio_signal_handler) == SIG_ERR) @@ -358,7 +373,37 @@ boost::system::error_code signal_set_service::add( delete new_registration; return ec; } +# if defined(BOOST_ASIO_HAS_SIGACTION) + state->flags_[signal_number] = f; +# endif // defined(BOOST_ASIO_HAS_SIGACTION) } +# if defined(BOOST_ASIO_HAS_SIGACTION) + // Otherwise check to see if the flags have changed. + else if (f != signal_set_base::flags::dont_care) + { + if (f != state->flags_[signal_number]) + { + using namespace std; // For memset. + if (state->flags_[signal_number] != signal_set_base::flags::dont_care) + { + ec = boost::asio::error::invalid_argument; + return ec; + } + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = boost_asio_signal_handler; + sigfillset(&sa.sa_mask); + sa.sa_flags = static_cast(f); + if (::sigaction(signal_number, &sa, 0) == -1) + { + ec = boost::system::error_code(errno, + boost::asio::error::get_system_category()); + return ec; + } + state->flags_[signal_number] = f; + } + } +# endif // defined(BOOST_ASIO_HAS_SIGACTION) #endif // defined(BOOST_ASIO_HAS_SIGNAL) || defined(BOOST_ASIO_HAS_SIGACTION) // Record the new registration in the set. @@ -427,6 +472,9 @@ boost::system::error_code signal_set_service::remove( # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) return ec; } +# if defined(BOOST_ASIO_HAS_SIGACTION) + state->flags_[signal_number] = signal_set_base::flags_t(); +# endif // defined(BOOST_ASIO_HAS_SIGACTION) } #endif // defined(BOOST_ASIO_HAS_SIGNAL) || defined(BOOST_ASIO_HAS_SIGACTION) @@ -481,6 +529,9 @@ boost::system::error_code signal_set_service::clear( # endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) return ec; } +# if defined(BOOST_ASIO_HAS_SIGACTION) + state->flags_[reg->signal_number_] = signal_set_base::flags_t(); +# endif // defined(BOOST_ASIO_HAS_SIGACTION) } #endif // defined(BOOST_ASIO_HAS_SIGNAL) || defined(BOOST_ASIO_HAS_SIGACTION) diff --git a/include/boost/asio/detail/signal_set_service.hpp b/include/boost/asio/detail/signal_set_service.hpp index cde3f6f4c3..39c062cad3 100644 --- a/include/boost/asio/detail/signal_set_service.hpp +++ b/include/boost/asio/detail/signal_set_service.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -141,8 +142,16 @@ class signal_set_service : BOOST_ASIO_DECL void destroy(implementation_type& impl); // Add a signal to a signal_set. + boost::system::error_code add(implementation_type& impl, + int signal_number, boost::system::error_code& ec) + { + return add(impl, signal_number, signal_set_base::flags::dont_care, ec); + } + + // Add a signal to a signal_set with the specified flags. BOOST_ASIO_DECL boost::system::error_code add(implementation_type& impl, - int signal_number, boost::system::error_code& ec); + int signal_number, signal_set_base::flags_t f, + boost::system::error_code& ec); // Remove a signal to a signal_set. BOOST_ASIO_DECL boost::system::error_code remove(implementation_type& impl, diff --git a/include/boost/asio/detail/socket_types.hpp b/include/boost/asio/detail/socket_types.hpp index 79d4e99c69..9eac34d444 100644 --- a/include/boost/asio/detail/socket_types.hpp +++ b/include/boost/asio/detail/socket_types.hpp @@ -89,6 +89,7 @@ # include # include # endif +# include #endif #include @@ -179,6 +180,7 @@ typedef int signed_size_type; # define BOOST_ASIO_OS_DEF_AI_V4MAPPED 0x800 # define BOOST_ASIO_OS_DEF_AI_ALL 0x100 # define BOOST_ASIO_OS_DEF_AI_ADDRCONFIG 0x400 +# define BOOST_ASIO_OS_DEF_SA_RESTART 0x1 #elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) typedef SOCKET socket_type; const SOCKET invalid_socket = INVALID_SOCKET; @@ -286,6 +288,7 @@ const int max_iov_len = 64; # else const int max_iov_len = 16; # endif +# define BOOST_ASIO_OS_DEF_SA_RESTART 0x1 #else typedef int socket_type; const int invalid_socket = -1; @@ -405,6 +408,7 @@ const int max_iov_len = IOV_MAX; // POSIX platforms are not required to define IOV_MAX. const int max_iov_len = 16; # endif +# define BOOST_ASIO_OS_DEF_SA_RESTART SA_RESTART #endif const int custom_socket_option_level = 0xA5100000; const int enable_connection_aborted_option = 1; diff --git a/include/boost/asio/signal_set_base.hpp b/include/boost/asio/signal_set_base.hpp new file mode 100644 index 0000000000..d0e5f9de67 --- /dev/null +++ b/include/boost/asio/signal_set_base.hpp @@ -0,0 +1,173 @@ +// +// signal_set_base.hpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_SIGNAL_SET_BASE_HPP +#define BOOST_ASIO_SIGNAL_SET_BASE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include + +#include + +namespace boost { +namespace asio { + +/// The signal_set_base class is used as a base for the basic_signal_set class +/// templates so that we have a common place to define the flags enum. +class signal_set_base +{ +public: +# if defined(GENERATING_DOCUMENTATION) + /// Enumeration representing the different types of flags that may specified + /// when adding a signal to a set. + enum flags + { + /// Bitmask representing no flags. + none = 0, + + /// Affects the behaviour of interruptible functions such that, if the + /// function would have failed with error::interrupted when interrupted by + /// the specified signal, the function shall instead be restarted and not + /// fail with error::interrupted. + restart = implementation_defined, + + /// Special value to indicate that the signal registration does not care + /// which flags are set, and so will not conflict with any prior + /// registrations of the same signal. + dont_care = -1 + }; + + /// Portability typedef. + typedef flags flags_t; +#elif defined(BOOST_ASIO_HAS_ENUM_CLASS) + enum class flags : int + { + none = 0, + restart = BOOST_ASIO_OS_DEF(SA_RESTART), + dont_care = -1 + }; + + typedef flags flags_t; +#else // defined(BOOST_ASIO_HAS_ENUM_CLASS) + struct flags + { + enum flags_t + { + none = 0, + restart = BOOST_ASIO_OS_DEF(SA_RESTART), + dont_care = -1 + }; + }; + + typedef flags::flags_t flags_t; +#endif // defined(BOOST_ASIO_HAS_ENUM_CLASS) + +protected: + /// Protected destructor to prevent deletion through this type. + ~signal_set_base() + { + } +}; + +/// Negation operator. +/** + * @relates signal_set_base::flags + */ +inline BOOST_ASIO_CONSTEXPR bool operator!(signal_set_base::flags_t x) +{ + return static_cast(x) == 0; +} + +/// Bitwise and operator. +/** + * @relates signal_set_base::flags + */ +inline BOOST_ASIO_CONSTEXPR signal_set_base::flags_t operator&( + signal_set_base::flags_t x, signal_set_base::flags_t y) +{ + return static_cast( + static_cast(x) & static_cast(y)); +} + +/// Bitwise or operator. +/** + * @relates signal_set_base::flags + */ +inline BOOST_ASIO_CONSTEXPR signal_set_base::flags_t operator|( + signal_set_base::flags_t x, signal_set_base::flags_t y) +{ + return static_cast( + static_cast(x) | static_cast(y)); +} + +/// Bitwise xor operator. +/** + * @relates signal_set_base::flags + */ +inline BOOST_ASIO_CONSTEXPR signal_set_base::flags_t operator^( + signal_set_base::flags_t x, signal_set_base::flags_t y) +{ + return static_cast( + static_cast(x) ^ static_cast(y)); +} + +/// Bitwise negation operator. +/** + * @relates signal_set_base::flags + */ +inline BOOST_ASIO_CONSTEXPR signal_set_base::flags_t operator~( + signal_set_base::flags_t x) +{ + return static_cast(~static_cast(x)); +} + +/// Bitwise and-assignment operator. +/** + * @relates signal_set_base::flags + */ +inline signal_set_base::flags_t& operator&=( + signal_set_base::flags_t& x, signal_set_base::flags_t y) +{ + x = x & y; + return x; +} + +/// Bitwise or-assignment operator. +/** + * @relates signal_set_base::flags + */ +inline signal_set_base::flags_t& operator|=( + signal_set_base::flags_t& x, signal_set_base::flags_t y) +{ + x = x | y; + return x; +} + +/// Bitwise xor-assignment operator. +/** + * @relates signal_set_base::flags + */ +inline signal_set_base::flags_t& operator^=( + signal_set_base::flags_t& x, signal_set_base::flags_t y) +{ + x = x ^ y; + return x; +} + +} // namespace asio +} // namespace boost + +#include + +#endif // BOOST_ASIO_SIGNAL_SET_BASE_HPP diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f607fb31b7..f27a8369d1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -234,6 +234,8 @@ test-suite "asio" : [ link registered_buffer.cpp : $(USE_SELECT) : registered_buffer_select ] [ run signal_set.cpp ] [ run signal_set.cpp : : : $(USE_SELECT) : signal_set_select ] + [ link signal_set_base.cpp ] + [ link signal_set_base.cpp : $(USE_SELECT) : signal_set_base_select ] [ run socket_base.cpp ] [ run socket_base.cpp : : : $(USE_SELECT) : socket_base_select ] [ run static_thread_pool.cpp ] diff --git a/test/signal_set.cpp b/test/signal_set.cpp index 68e81dd62b..104e35278f 100644 --- a/test/signal_set.cpp +++ b/test/signal_set.cpp @@ -66,6 +66,9 @@ void test() set1.add(1); set1.add(1, ec); + set1.add(1, signal_set::flags::dont_care); + set1.add(1, signal_set::flags::dont_care, ec); + set1.remove(1); set1.remove(1, ec); diff --git a/test/signal_set_base.cpp b/test/signal_set_base.cpp new file mode 100644 index 0000000000..cce3f75227 --- /dev/null +++ b/test/signal_set_base.cpp @@ -0,0 +1,30 @@ +// +// signal_set_base.cpp +// ~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +// Disable autolinking for unit tests. +#if !defined(BOOST_ALL_NO_LIB) +#define BOOST_ALL_NO_LIB 1 +#endif // !defined(BOOST_ALL_NO_LIB) + +// Prevent link dependency on the Boost.System library. +#if !defined(BOOST_SYSTEM_NO_DEPRECATED) +#define BOOST_SYSTEM_NO_DEPRECATED +#endif // !defined(BOOST_SYSTEM_NO_DEPRECATED) + +// Test that header file is self-contained. +#include + +#include "unit_test.hpp" + +BOOST_ASIO_TEST_SUITE +( + "signal_set_base", + BOOST_ASIO_TEST_CASE(null_test) +) From 4b166523205f77af5346a46302f8af6a16b3d73f Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:39:34 +1100 Subject: [PATCH 09/22] Reset timer_thread_ in win_iocp_io_context::shutdown(). Resets timer_thread in shutdown for the case when shutdown is called more than once. --- include/boost/asio/detail/impl/win_iocp_io_context.ipp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/asio/detail/impl/win_iocp_io_context.ipp b/include/boost/asio/detail/impl/win_iocp_io_context.ipp index ceccad046f..72fa751c1e 100644 --- a/include/boost/asio/detail/impl/win_iocp_io_context.ipp +++ b/include/boost/asio/detail/impl/win_iocp_io_context.ipp @@ -169,7 +169,10 @@ void win_iocp_io_context::shutdown() } if (timer_thread_.get()) + { timer_thread_->join(); + timer_thread_.reset(); + } } boost::system::error_code win_iocp_io_context::register_handle( From adfeed2b5d5220ed17d64366c688670f42c6cebe Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:40:03 +1100 Subject: [PATCH 10/22] Add any_completion_handler to the documentation. --- doc/quickref.xml | 1 + doc/reference.xsl | 3 +- include/boost/asio/any_completion_handler.hpp | 74 +++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/doc/quickref.xml b/doc/quickref.xml index 6b057ee511..714adffe02 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -263,6 +263,7 @@ Class Templates any_completion_handler + any_completion_handler_allocator append_t as_tuple_t async_completion diff --git a/doc/reference.xsl b/doc/reference.xsl index c1199f6d24..68128813f7 100644 --- a/doc/reference.xsl +++ b/doc/reference.xsl @@ -133,7 +133,8 @@ not(contains(compoundname, 'context_impl')) and not(contains(compoundname, 'initiate_')) and not(contains(compoundname, '_adapter')) and - not(contains(compoundname, '_is_deprecated'))"> + not(contains(compoundname, '_is_deprecated')) or + contains(compoundname, 'asio::any_completion_handler')"> diff --git a/include/boost/asio/any_completion_handler.hpp b/include/boost/asio/any_completion_handler.hpp index ba5b542486..ae73387ebd 100644 --- a/include/boost/asio/any_completion_handler.hpp +++ b/include/boost/asio/any_completion_handler.hpp @@ -416,6 +416,8 @@ any_completion_handler_fn_table_instance::value; template class any_completion_handler; +/// An allocator type that forwards memory allocation operations through an +/// instance of @c any_completion_handler. template class any_completion_handler_allocator { @@ -437,14 +439,18 @@ class any_completion_handler_allocator } public: + /// The type of objects that may be allocated by the allocator. typedef T value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) @@ -454,18 +460,21 @@ class any_completion_handler_allocator { } + /// Equality operator. constexpr bool operator==( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ != other.fn_table_ || impl_ != other.impl_; } + /// Allocate space for @c n objects of the allocator's value type. T* allocate(std::size_t n) const { return static_cast( @@ -473,12 +482,16 @@ class any_completion_handler_allocator impl_, sizeof(T) * n, alignof(T))); } + /// Deallocate space for @c n objects of the allocator's value type. void deallocate(T* p, std::size_t n) const { fn_table_->deallocate(impl_, p, sizeof(T) * n, alignof(T)); } }; +/// A protoco-allocator type that may be rebound to obtain an allocator that +/// forwards memory allocation operations through an instance of +/// @c any_completion_handler. template class any_completion_handler_allocator { @@ -500,14 +513,18 @@ class any_completion_handler_allocator } public: + /// @c void as no objects can be allocated through a proto-allocator. typedef void value_type; + /// Rebinds an allocator to another value type. template struct rebind { + /// Specifies the type of the rebound allocator. typedef any_completion_handler_allocator other; }; + /// Construct from another @c any_completion_handler_allocator. template constexpr any_completion_handler_allocator( const any_completion_handler_allocator& a) @@ -517,12 +534,14 @@ class any_completion_handler_allocator { } + /// Equality operator. constexpr bool operator==( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { return fn_table_ == other.fn_table_ && impl_ == other.impl_; } + /// Inequality operator. constexpr bool operator!=( const any_completion_handler_allocator& other) const BOOST_ASIO_NOEXCEPT { @@ -530,9 +549,27 @@ class any_completion_handler_allocator } }; +/// Polymorphic wrapper for completion handlers. +/** + * The @c any_completion_handler class template is a polymorphic wrapper for + * completion handlers that propagates the associated executor, associated + * allocator, and associated cancellation slot through a type-erasing interface. + * + * When using @c any_completion_handler, specify one or more completion + * signatures as template parameters. These will dictate the arguments that may + * be passed to the handler through the polymorphic interface. + * + * Typical uses for @c any_completion_handler include: + * + * @li Separate compilation of asynchronous operation implementations. + * + * @li Enabling interoperability between asynchronous operations and virtual + * functions. + */ template class any_completion_handler { +#if !defined(GENERATING_DOCUMENTATION) private: template friend class any_completion_handler_allocator; @@ -542,23 +579,32 @@ class any_completion_handler const detail::any_completion_handler_fn_table* fn_table_; detail::any_completion_handler_impl_base* impl_; +#endif // !defined(GENERATING_DOCUMENTATION) public: + /// The associated allocator type. using allocator_type = any_completion_handler_allocator; + + /// The associated cancellation slot type. using cancellation_slot_type = cancellation_slot; + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler() : fn_table_(nullptr), impl_(nullptr) { } + /// Construct an @c any_completion_handler in an empty state, without a target + /// object. constexpr any_completion_handler(nullptr_t) : fn_table_(nullptr), impl_(nullptr) { } + /// Construct an @c any_completion_handler to contain the specified target. template ::type> any_completion_handler(H&& h, typename constraint< @@ -572,6 +618,10 @@ class any_completion_handler { } + /// Move-construct an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ any_completion_handler(any_completion_handler&& other) BOOST_ASIO_NOEXCEPT : fn_table_(other.fn_table_), impl_(other.impl_) @@ -580,6 +630,10 @@ class any_completion_handler other.impl_ = nullptr; } + /// Move-assign an @c any_completion_handler from another. + /** + * After the operation, the moved-from object @c other has no target. + */ any_completion_handler& operator=( any_completion_handler&& other) BOOST_ASIO_NOEXCEPT { @@ -588,44 +642,60 @@ class any_completion_handler return *this; } + /// Assignment operator that sets the polymorphic wrapper to the empty state. any_completion_handler& operator=(nullptr_t) BOOST_ASIO_NOEXCEPT { any_completion_handler().swap(*this); return *this; } + /// Destructor. ~any_completion_handler() { if (impl_) fn_table_->destroy(impl_); } + /// Test if the polymorphic wrapper is empty. constexpr explicit operator bool() const BOOST_ASIO_NOEXCEPT { return impl_ != nullptr; } + /// Test if the polymorphic wrapper is non-empty. constexpr bool operator!() const BOOST_ASIO_NOEXCEPT { return impl_ == nullptr; } + /// Swap the content of an @c any_completion_handler with another. void swap(any_completion_handler& other) BOOST_ASIO_NOEXCEPT { std::swap(fn_table_, other.fn_table_); std::swap(impl_, other.impl_); } + /// Get the associated allocator. allocator_type get_allocator() const BOOST_ASIO_NOEXCEPT { return allocator_type(0, *this); } + /// Get the associated cancellation slot. cancellation_slot_type get_cancellation_slot() const BOOST_ASIO_NOEXCEPT { return impl_->get_cancellation_slot(); } + /// Function call operator. + /** + * Invokes target completion handler with the supplied arguments. + * + * This function may only be called once, as the target handler is moved from. + * The polymorphic wrapper is left in an empty state. + * + * Throws @c std::bad_function_call if the polymorphic wrapper is empty. + */ template auto operator()(Args&&... args) -> decltype(fn_table_->call(impl_, BOOST_ASIO_MOVE_CAST(Args)(args)...)) @@ -639,24 +709,28 @@ class any_completion_handler boost::asio::detail::throw_exception(ex); } + /// Equality operator. friend constexpr bool operator==( const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT { return a.impl_ == nullptr; } + /// Equality operator. friend constexpr bool operator==( nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT { return nullptr == b.impl_; } + /// Inequality operator. friend constexpr bool operator!=( const any_completion_handler& a, nullptr_t) BOOST_ASIO_NOEXCEPT { return a.impl_ != nullptr; } + /// Inequality operator. friend constexpr bool operator!=( nullptr_t, const any_completion_handler& b) BOOST_ASIO_NOEXCEPT { From e33be4b6b9613bdabf30d66d8fd9e74bf8362ffd Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Mon, 6 Mar 2023 23:40:16 +1100 Subject: [PATCH 11/22] Fix execution context overloads of get_associated_executor and get_associated_immediate_executor. --- include/boost/asio/associated_executor.hpp | 3 ++- include/boost/asio/associated_immediate_executor.hpp | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/boost/asio/associated_executor.hpp b/include/boost/asio/associated_executor.hpp index 8533e521de..4ffc80f9a6 100644 --- a/include/boost/asio/associated_executor.hpp +++ b/include/boost/asio/associated_executor.hpp @@ -173,7 +173,8 @@ get_associated_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -BOOST_ASIO_NODISCARD inline typename ExecutionContext::executor_type +BOOST_ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t, ExecutionContext& ctx, typename constraint::value>::type = 0) BOOST_ASIO_NOEXCEPT diff --git a/include/boost/asio/associated_immediate_executor.hpp b/include/boost/asio/associated_immediate_executor.hpp index 295744e00d..d73d395f75 100644 --- a/include/boost/asio/associated_immediate_executor.hpp +++ b/include/boost/asio/associated_immediate_executor.hpp @@ -222,15 +222,11 @@ get_associated_immediate_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -BOOST_ASIO_NODISCARD inline BOOST_ASIO_AUTO_RETURN_TYPE_PREFIX2( - typename associated_immediate_executor::type) +BOOST_ASIO_NODISCARD inline typename associated_immediate_executor::type get_associated_immediate_executor(const T& t, ExecutionContext& ctx, typename constraint::value>::type = 0) BOOST_ASIO_NOEXCEPT - BOOST_ASIO_AUTO_RETURN_TYPE_SUFFIX(( - associated_immediate_executor::get(t, ctx.get_executor()))) { return associated_immediate_executor::get(t, ctx.get_executor()); From 256d56ca0134555e32782ad98184b5f8faeed41a Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 7 Mar 2023 00:10:10 +1100 Subject: [PATCH 12/22] Regenerate documentation. --- doc/reference.qbk | 4752 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 4483 insertions(+), 269 deletions(-) diff --git a/doc/reference.qbk b/doc/reference.qbk index fd2b746d72..16aff5458a 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -1828,6 +1828,989 @@ Destructor. +[endsect] + +[section:any_completion_handler any_completion_handler] + +[indexterm1 boost_asio.indexterm.any_completion_handler..any_completion_handler] + + +Polymorphic wrapper for completion handlers. + + + template< + typename... Signatures> + class any_completion_handler + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler.any_completion_handler [*any_completion_handler]] [constructor]] + [Construct an any_completion_handler in an empty state, without a target object. + [hr] + Construct an any_completion_handler to contain the specified target. + [hr] + Move-construct an any_completion_handler from another. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.get_allocator [*get_allocator]]] + [Get the associated allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.get_cancellation_slot [*get_cancellation_slot]]] + [Get the associated cancellation slot. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_bool [*operator bool]]] + [Test if the polymorphic wrapper is empty. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_not_ [*operator!]]] + [Test if the polymorphic wrapper is non-empty. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_lp__rp_ [*operator()]]] + [Function call operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_eq_ [*operator=]]] + [Move-assign an any_completion_handler from another. + [hr] + Assignment operator that sets the polymorphic wrapper to the empty state. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.swap [*swap]]] + [Swap the content of an any_completion_handler with another. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler._any_completion_handler [*~any_completion_handler]] [destructor]] + [Destructor. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +The `any_completion_handler` class template is a polymorphic wrapper for completion handlers that propagates the associated executor, associated allocator, and associated cancellation slot through a type-erasing interface. + +When using `any_completion_handler`, specify one or more completion signatures as template parameters. These will dictate the arguments that may be passed to the handler through the polymorphic interface. + +Typical uses for `any_completion_handler` include: + + +* Separate compilation of asynchronous operation implementations. + + +* Enabling interoperability between asynchronous operations and virtual functions. + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + +[section:any_completion_handler any_completion_handler::any_completion_handler] + +[indexterm2 boost_asio.indexterm.any_completion_handler.any_completion_handler..any_completion_handler..any_completion_handler] +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload1 any_completion_handler]``(); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload1 more...]]`` + + constexpr ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload2 any_completion_handler]``( + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload2 more...]]`` + + +Construct an `any_completion_handler` to contain the specified target. + + + template< + typename H, + typename ``[link boost_asio.reference.Handler Handler]`` = typename decay::type> + ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload3 any_completion_handler]``( + H && h, + typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload3 more...]]`` + + +Move-construct an `any_completion_handler` from another. + + + ``[link boost_asio.reference.any_completion_handler.any_completion_handler.overload4 any_completion_handler]``( + any_completion_handler && other); + `` [''''»''' [link boost_asio.reference.any_completion_handler.any_completion_handler.overload4 more...]]`` + + +[section:overload1 any_completion_handler::any_completion_handler (1 of 4 overloads)] + + +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr any_completion_handler(); + + + +[endsect] + + + +[section:overload2 any_completion_handler::any_completion_handler (2 of 4 overloads)] + + +Construct an `any_completion_handler` in an empty state, without a target object. + + + constexpr any_completion_handler( + nullptr_t ); + + + +[endsect] + + + +[section:overload3 any_completion_handler::any_completion_handler (3 of 4 overloads)] + + +Construct an `any_completion_handler` to contain the specified target. + + + template< + typename H, + typename ``[link boost_asio.reference.Handler Handler]`` = typename decay::type> + any_completion_handler( + H && h, + typename constraint< !is_same< typename decay< H >::type, any_completion_handler >::value >::type = 0); + + + +[endsect] + + + +[section:overload4 any_completion_handler::any_completion_handler (4 of 4 overloads)] + + +Move-construct an `any_completion_handler` from another. + + + any_completion_handler( + any_completion_handler && other); + + +After the operation, the moved-from object `other` has no target. + + +[endsect] + + +[endsect] + + +[section:get_allocator any_completion_handler::get_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler.get_allocator..get_allocator..any_completion_handler] +Get the associated allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:get_cancellation_slot any_completion_handler::get_cancellation_slot] + +[indexterm2 boost_asio.indexterm.any_completion_handler.get_cancellation_slot..get_cancellation_slot..any_completion_handler] +Get the associated cancellation slot. + + + cancellation_slot_type get_cancellation_slot() const; + + + +[endsect] + + + +[section:operator_bool any_completion_handler::operator bool] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_bool..operator bool..any_completion_handler] +Test if the polymorphic wrapper is empty. + + + constexpr operator bool() const; + + + +[endsect] + + + +[section:operator_not_ any_completion_handler::operator!] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_not_..operator!..any_completion_handler] +Test if the polymorphic wrapper is non-empty. + + + constexpr bool operator!() const; + + + +[endsect] + + +[section:operator_not__eq_ any_completion_handler::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_not__eq_..operator!=..any_completion_handler] +Inequality operator. + + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_not__eq_.overload1 operator!=]``( + const any_completion_handler & a, + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_not__eq_.overload1 more...]]`` + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_not__eq_.overload2 operator!=]``( + nullptr_t , + const any_completion_handler & b); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_not__eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator!= (1 of 2 overloads)] + + +Inequality operator. + + + friend constexpr bool operator!=( + const any_completion_handler & a, + nullptr_t ); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:overload2 any_completion_handler::operator!= (2 of 2 overloads)] + + +Inequality operator. + + + friend constexpr bool operator!=( + nullptr_t , + const any_completion_handler & b); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[endsect] + + +[section:operator_lp__rp_ any_completion_handler::operator()] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_lp__rp_..operator()..any_completion_handler] +Function call operator. + + + template< + typename... Args> + auto operator()( + Args &&... args); + + +Invokes target completion handler with the supplied arguments. + +This function may only be called once, as the target handler is moved from. The polymorphic wrapper is left in an empty state. + +Throws `std::bad_function_call` if the polymorphic wrapper is empty. + + +[endsect] + + +[section:operator_eq_ any_completion_handler::operator=] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_eq_..operator=..any_completion_handler] +Move-assign an `any_completion_handler` from another. + + + any_completion_handler & ``[link boost_asio.reference.any_completion_handler.operator_eq_.overload1 operator=]``( + any_completion_handler && other); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq_.overload1 more...]]`` + + +Assignment operator that sets the polymorphic wrapper to the empty state. + + + any_completion_handler & ``[link boost_asio.reference.any_completion_handler.operator_eq_.overload2 operator=]``( + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator= (1 of 2 overloads)] + + +Move-assign an `any_completion_handler` from another. + + + any_completion_handler & operator=( + any_completion_handler && other); + + +After the operation, the moved-from object `other` has no target. + + +[endsect] + + + +[section:overload2 any_completion_handler::operator= (2 of 2 overloads)] + + +Assignment operator that sets the polymorphic wrapper to the empty state. + + + any_completion_handler & operator=( + nullptr_t ); + + + +[endsect] + + +[endsect] + +[section:operator_eq__eq_ any_completion_handler::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler.operator_eq__eq_..operator==..any_completion_handler] +Equality operator. + + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload1 operator==]``( + const any_completion_handler & a, + nullptr_t ); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload1 more...]]`` + + friend constexpr bool ``[link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload2 operator==]``( + nullptr_t , + const any_completion_handler & b); + `` [''''»''' [link boost_asio.reference.any_completion_handler.operator_eq__eq_.overload2 more...]]`` + + +[section:overload1 any_completion_handler::operator== (1 of 2 overloads)] + + +Equality operator. + + + friend constexpr bool operator==( + const any_completion_handler & a, + nullptr_t ); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:overload2 any_completion_handler::operator== (2 of 2 overloads)] + + +Equality operator. + + + friend constexpr bool operator==( + nullptr_t , + const any_completion_handler & b); + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[endsect] + + +[section:swap any_completion_handler::swap] + +[indexterm2 boost_asio.indexterm.any_completion_handler.swap..swap..any_completion_handler] +Swap the content of an `any_completion_handler` with another. + + + void swap( + any_completion_handler & other); + + + +[endsect] + + + +[section:_any_completion_handler any_completion_handler::~any_completion_handler] + +[indexterm2 boost_asio.indexterm.any_completion_handler._any_completion_handler..~any_completion_handler..any_completion_handler] +Destructor. + + + ~any_completion_handler(); + + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator any_completion_handler_allocator] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator..any_completion_handler_allocator] + + +An allocator type that forwards memory allocation operations through an instance of `any_completion_handler`. + + + template< + typename T, + typename... Signatures> + class any_completion_handler_allocator + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:allocate any_completion_handler_allocator::allocate] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.allocate..allocate..any_completion_handler_allocator] +Allocate space for `n` objects of the allocator's value type. + + + T * allocate( + std::size_t n) const; + + + +[endsect] + + + +[section:any_completion_handler_allocator any_completion_handler_allocator::any_completion_handler_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator] +Construct from another `any_completion_handler_allocator`. + + + template< + typename U> + constexpr any_completion_handler_allocator( + const any_completion_handler_allocator< U, Signatures...> & a); + + + +[endsect] + + + +[section:deallocate any_completion_handler_allocator::deallocate] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.deallocate..deallocate..any_completion_handler_allocator] +Deallocate space for `n` objects of the allocator's value type. + + + void deallocate( + T * p, + std::size_t n) const; + + + +[endsect] + + + +[section:operator_not__eq_ any_completion_handler_allocator::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.operator_not__eq_..operator!=..any_completion_handler_allocator] +Inequality operator. + + + constexpr bool operator!=( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:operator_eq__eq_ any_completion_handler_allocator::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.operator_eq__eq_..operator==..any_completion_handler_allocator] +Equality operator. + + + constexpr bool operator==( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:value_type any_completion_handler_allocator::value_type] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator.value_type..value_type..any_completion_handler_allocator] +The type of objects that may be allocated by the allocator. + + + typedef T value_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator__rebind any_completion_handler_allocator::rebind] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator__rebind..any_completion_handler_allocator::rebind] + + +Rebinds an allocator to another value type. + + + template< + typename U> + struct rebind + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator__rebind.other [*other]]] + [Specifies the type of the rebound allocator. ] + + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:other any_completion_handler_allocator::rebind::other] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator__rebind.other..other..any_completion_handler_allocator::rebind] +Specifies the type of the rebound allocator. + + + typedef any_completion_handler_allocator< U, Signatures...> other; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_ any_completion_handler_allocator< void, Signatures...>] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_..any_completion_handler_allocator< void, Signatures\.\.\.>] + + +A protoco-allocator type that may be rebound to obtain an allocator that forwards memory allocation operations through an instance of `any_completion_handler`. + + + template< + typename... Signatures> + class any_completion_handler_allocator< void, Signatures...> + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type [*value_type]]] + [void as no objects can be allocated through a proto-allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator [*any_completion_handler_allocator]]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:any_completion_handler_allocator any_completion_handler_allocator< void, Signatures...>::any_completion_handler_allocator] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.any_completion_handler_allocator..any_completion_handler_allocator..any_completion_handler_allocator< void, Signatures\.\.\.>] +Construct from another `any_completion_handler_allocator`. + + + template< + typename U> + constexpr any_completion_handler_allocator( + const any_completion_handler_allocator< U, Signatures...> & a); + + + +[endsect] + + + +[section:operator_not__eq_ any_completion_handler_allocator< void, Signatures...>::operator!=] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_not__eq_..operator!=..any_completion_handler_allocator< void, Signatures\.\.\.>] +Inequality operator. + + + constexpr bool operator!=( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:operator_eq__eq_ any_completion_handler_allocator< void, Signatures...>::operator==] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.operator_eq__eq_..operator==..any_completion_handler_allocator< void, Signatures\.\.\.>] +Equality operator. + + + constexpr bool operator==( + const any_completion_handler_allocator & other) const; + + + +[endsect] + + + +[section:value_type any_completion_handler_allocator< void, Signatures...>::value_type] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt_.value_type..value_type..any_completion_handler_allocator< void, Signatures\.\.\.>] +`void` as no objects can be allocated through a proto-allocator. + + + typedef void value_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind any_completion_handler_allocator< void, Signatures...>::rebind] + +[indexterm1 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] + + +Rebinds an allocator to another value type. + + + template< + typename U> + struct any_completion_handler_allocator< void, Signatures...>::rebind + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other [*other]]] + [Specifies the type of the rebound allocator. ] + + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:other any_completion_handler_allocator< void, Signatures...>::rebind::other] + +[indexterm2 boost_asio.indexterm.any_completion_handler_allocator_lt__void_comma__Signatures_ellipsis__gt___rebind.other..other..any_completion_handler_allocator< void, Signatures\.\.\.>::rebind] +Specifies the type of the rebound allocator. + + + typedef any_completion_handler_allocator< U, Signatures...> other; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.any_completion_handler_allocator.value_type [*value_type]]] + [The type of objects that may be allocated by the allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.allocate [*allocate]]] + [Allocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.any_completion_handler_allocator [*any_completion_handler_allocator]] [constructor]] + [Construct from another any_completion_handler_allocator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.deallocate [*deallocate]]] + [Deallocate space for n objects of the allocator's value type. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_not__eq_ [*operator!=]]] + [Inequality operator. ] + ] + + [ + [[link boost_asio.reference.any_completion_handler_allocator.operator_eq__eq_ [*operator==]]] + [Equality operator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/any_completion_handler.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [endsect] [section:any_io_executor any_io_executor] @@ -4186,7 +5169,7 @@ Forwards the request to get the cancellation slot to the associator specialisati static auto ``[link boost_asio.reference.associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.get.overload2 get]``( reference_wrapper< T > t, - const CancellationSlot & s = CancellationSlot()); + const CancellationSlot & s); `` [''''»''' [link boost_asio.reference.associated_cancellation_slot_lt__reference_wrapper_lt__T__gt__comma__CancellationSlot__gt_.get.overload2 more...]]`` @@ -4213,7 +5196,7 @@ Forwards the request to get the cancellation slot to the associator specialisati static auto get( reference_wrapper< T > t, - const CancellationSlot & s = CancellationSlot()); + const CancellationSlot & s); @@ -4622,6 +5605,261 @@ Specialisations shall meet the following requirements, where `t` is a const refe +[endsect] + +[section:associated_immediate_executor associated_immediate_executor] + +[indexterm1 boost_asio.indexterm.associated_immediate_executor..associated_immediate_executor] + + +Traits type used to obtain the immediate executor associated with an object. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + struct associated_immediate_executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor.type [*type]]] + [If T has a nested type immediate_executor_type,. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns boost::asio::require(ex, boost::asio::execution::blocking.never). ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.noexcept [*noexcept]]] + [] + ] + +] + +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `Executor` shall be a type meeting the Executor requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `e` is an object of type `Executor`. + + +* Provide a nested typedef `type` that identifies a type meeting the Executor requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:decltype associated_immediate_executor::decltype] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.decltype..decltype..associated_immediate_executor] +If `T` has a nested type `immediate_executor_type`, returns `t.get_immediate_executor()`. Otherwise returns `boost::asio::require(ex, boost::asio::execution::blocking.never)`. + + + static static decltype( + auto ) const; + + + +[endsect] + + + +[section:noexcept associated_immediate_executor::noexcept] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.noexcept..noexcept..associated_immediate_executor] + + const Executor &ex noexcept; + + + +[endsect] + + + +[section:type associated_immediate_executor::type] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor.type..type..associated_immediate_executor] +If `T` has a nested type `immediate_executor_type`,. + + + typedef see_below type; + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[endsect] + +[section:associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_ associated_immediate_executor< reference_wrapper< T >, Executor >] + +[indexterm1 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_..associated_immediate_executor< reference_wrapper< T >, Executor >] + + +Specialisation of [link boost_asio.reference.associated_immediate_executor `associated_immediate_executor`] for `std::reference_wrapper`. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + struct associated_immediate_executor< reference_wrapper< T >, Executor > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.type [*type]]] + [Forwards type to the associator specialisation for the unwrapped type T. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.get [*get]] [static]] + [Forwards the request to get the executor to the associator specialisation for the unwrapped type T. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:get associated_immediate_executor< reference_wrapper< T >, Executor >::get] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.get..get..associated_immediate_executor< reference_wrapper< T >, Executor >] +Forwards the request to get the executor to the associator specialisation for the unwrapped type `T`. + + + static auto get( + reference_wrapper< T > t, + const Executor & ex); + + + +[endsect] + + + +[section:type associated_immediate_executor< reference_wrapper< T >, Executor >::type] + +[indexterm2 boost_asio.indexterm.associated_immediate_executor_lt__reference_wrapper_lt__T__gt__comma__Executor__gt_.type..type..associated_immediate_executor< reference_wrapper< T >, Executor >] +Forwards `type` to the associator specialisation for the unwrapped type `T`. + + + typedef associated_immediate_executor< T, Executor >::type type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.associated_immediate_executor.type [*type]]] + [If T has a nested type immediate_executor_type,. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.decltype [*decltype]] [static]] + [If T has a nested type immediate_executor_type, returns t.get_immediate_executor(). Otherwise returns boost::asio::require(ex, boost::asio::execution::blocking.never). ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.associated_immediate_executor.noexcept [*noexcept]]] + [] + ] + +] + +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `Executor` shall be a type meeting the Executor requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `e` is an object of type `Executor`. + + +* Provide a nested typedef `type` that identifies a type meeting the Executor requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type` or a (possibly const) reference to `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type` or a (possibly const) reference to `type`. + + + + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [endsect] [section:associator associator] @@ -41483,7 +42721,8 @@ Provides signal functionality. template< typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> - class basic_signal_set + class basic_signal_set : + public signal_set_base [heading Types] @@ -41504,6 +42743,20 @@ Provides signal functionality. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -41512,7 +42765,9 @@ Provides signal functionality. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -41640,7 +42895,22 @@ Add a signal to a signal\_set. `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload2 more...]]`` -[section:overload1 basic_signal_set::add (1 of 2 overloads)] +Add a signal to a signal\_set with the specified flags. + + + void ``[link boost_asio.reference.basic_signal_set.add.overload3 add]``( + int signal_number, + flags_t f); + `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload3 more...]]`` + + void ``[link boost_asio.reference.basic_signal_set.add.overload4 add]``( + int signal_number, + flags_t f, + boost::system::error_code & ec); + `` [''''»''' [link boost_asio.reference.basic_signal_set.add.overload4 more...]]`` + + +[section:overload1 basic_signal_set::add (1 of 4 overloads)] Add a signal to a signal\_set. @@ -41679,7 +42949,7 @@ This function adds the specified signal to the set. It has no effect if the sign -[section:overload2 basic_signal_set::add (2 of 2 overloads)] +[section:overload2 basic_signal_set::add (2 of 4 overloads)] Add a signal to a signal\_set. @@ -41707,6 +42977,91 @@ This function adds the specified signal to the set. It has no effect if the sign +[endsect] + + + +[section:overload3 basic_signal_set::add (3 of 4 overloads)] + + +Add a signal to a signal\_set with the specified flags. + + + void add( + int signal_number, + flags_t f); + + +This function adds the specified signal to the set. It has no effect if the signal is already in the set. + +Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. + +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. + + +[heading Parameters] + + +[variablelist + +[[signal_number][The signal to be added to the set.]] + +[[f][Flags to modify the behaviour of the specified signal.]] + +] + + +[heading Exceptions] + + +[variablelist + +[[boost::system::system_error][Thrown on failure. ]] + +] + + + + +[endsect] + + + +[section:overload4 basic_signal_set::add (4 of 4 overloads)] + + +Add a signal to a signal\_set with the specified flags. + + + void add( + int signal_number, + flags_t f, + boost::system::error_code & ec); + + +This function adds the specified signal to the set. It has no effect if the signal is already in the set. + +Flags other than flags::dont\_care require OS support for the `sigaction` call, and this function will fail with `error::operation_not_supported` if this is unavailable. + +The specified flags will conflict with a prior, active registration of the same signal, if either specified a flags value other than flags::dont\_care. In this case, the `add` will fail with `error::invalid_argument`. + + +[heading Parameters] + + +[variablelist + +[[signal_number][The signal to be added to the set.]] + +[[f][Flags to modify the behaviour of the specified signal.]] + +[[ec][Set to indicate what error occurred, if any. ]] + +] + + + + [endsect] @@ -42412,6 +43767,70 @@ The type of the executor associated with the object. +[section:flags basic_signal_set::flags] + + +['Inherited from signal_set_base.] + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags..flags..basic_signal_set] +Enumeration representing the different types of flags that may specified when adding a signal to a set. + + enum flags + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.none..none..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.restart..restart..basic_signal_set] +[indexterm2 boost_asio.indexterm.basic_signal_set.flags.dont_care..dont_care..basic_signal_set] + +[heading Values] +[variablelist + + [ + [none] + [Bitmask representing no flags. ] + ] + + [ + [restart] + [Affects the behaviour of interruptible functions such that, if the function would have failed with error::interrupted when interrupted by the specified signal, the function shall instead be restarted and not fail with error::interrupted. ] + ] + + [ + [dont_care] + [Special value to indicate that the signal registration does not care which flags are set, and so will not conflict with any prior registrations of the same signal. ] + ] + +] + + + +[endsect] + + + +[section:flags_t basic_signal_set::flags_t] + + +['Inherited from signal_set_base.] + +[indexterm2 boost_asio.indexterm.basic_signal_set.flags_t..flags_t..basic_signal_set] +Portability typedef. + + + typedef flags flags_t; + + + +[heading Requirements] + +['Header: ][^boost/asio/basic_signal_set.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + [section:get_executor basic_signal_set::get_executor] [indexterm2 boost_asio.indexterm.basic_signal_set.get_executor..get_executor..basic_signal_set] @@ -42602,6 +44021,20 @@ The signal set type when rebound to the specified executor. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -42610,7 +44043,9 @@ The signal set type when rebound to the specified executor. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -70730,6 +72165,32 @@ Associate an object of type `T` with an execution context's executor. [endsect] + +[section:bind_immediate_executor bind_immediate_executor] + +[indexterm1 boost_asio.indexterm.bind_immediate_executor..bind_immediate_executor] + +Associate an object of type `T` with a immediate executor of type `Executor`. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename T> + immediate_executor_binder< typename decay< T >::type, Executor > bind_immediate_executor( + const Executor & e, + T && t); + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + [section:buffer buffer] [indexterm1 boost_asio.indexterm.buffer..buffer] @@ -72782,6 +74243,64 @@ The number of bytes copied is the lesser of: This function is implemented in terms of `memcpy`, and consequently it cannot be used to copy between overlapping memory regions. +[endsect] + + +[endsect] + +[section:buffer_literals__operator""_buf buffer_literals::operator""_buf] + +[indexterm1 boost_asio.indexterm.buffer_literals__operator""_buf..buffer_literals::operator""_buf] + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from string literals. + + const_buffer ``[link boost_asio.reference.buffer_literals__operator""_buf.overload1 operator""_buf]``( + const char * data, + std::size_t n); + `` [''''»''' [link boost_asio.reference.buffer_literals__operator""_buf.overload1 more...]]`` + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from unbounded binary or hexadecimal integer literals. + + template< + char... ``[link boost_asio.reference.Chars Chars]``> + const_buffer ``[link boost_asio.reference.buffer_literals__operator""_buf.overload2 operator""_buf]``(); + `` [''''»''' [link boost_asio.reference.buffer_literals__operator""_buf.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/buffer.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 buffer_literals::operator""_buf (1 of 2 overloads)] + + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from string literals. + + + const_buffer operator""_buf( + const char * data, + std::size_t n); + + + +[endsect] + + + +[section:overload2 buffer_literals::operator""_buf (2 of 2 overloads)] + + +Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from unbounded binary or hexadecimal integer literals. + + + template< + char... ``[link boost_asio.reference.Chars Chars]``> + const_buffer operator""_buf(); + + + [endsect] @@ -81838,7 +83357,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link boost_asio.reference.defer.overload2 defer]``( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); `` [''''»''' [link boost_asio.reference.defer.overload2 more...]]`` template< @@ -81973,7 +83492,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` defer( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. @@ -99461,7 +100980,8 @@ The main type of a resumable coroutine. template< typename Yield = void, typename Return = void, - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor, + typename Allocator = std::allocator> struct coro @@ -99483,6 +101003,11 @@ The main type of a resumable coroutine. ] ] + [ + [[link boost_asio.reference.experimental__coro.get_allocator [*get_allocator]]] + [Get the used allocator. ] + ] + [ [[link boost_asio.reference.experimental__coro.get_executor [*get_executor]]] [Get the used executor. ] @@ -99709,6 +101234,20 @@ Move constructor. [endsect] +[section:get_allocator experimental::coro::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__coro.get_allocator..get_allocator..experimental::coro] +Get the used allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + [section:get_executor experimental::coro::get_executor] [indexterm2 boost_asio.indexterm.experimental__coro.get_executor..get_executor..experimental::coro] @@ -100033,6 +101572,53 @@ Whether or not the coroutine is noexcept. [endsect] +[section:experimental__is_async_operation_range experimental::is_async_operation_range] + +[indexterm1 boost_asio.indexterm.experimental__is_async_operation_range..experimental::is_async_operation_range] + + +Type trait used to determine whether a type is a range of asynchronous operations that can be used with with `make_parallel_group`. + + + template< + typename T> + struct is_async_operation_range + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__is_async_operation_range.value [*value]] [static]] + [The value member is true if the type may be used as a range of asynchronous operations. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/experimental/parallel_group.hpp] + +['Convenience header: ]None + + +[section:value experimental::is_async_operation_range::value] + +[indexterm2 boost_asio.indexterm.experimental__is_async_operation_range.value..value..experimental::is_async_operation_range] +The value member is true if the type may be used as a range of asynchronous operations. + + + static const bool value; + + + +[endsect] + + + +[endsect] + [section:experimental__is_promise experimental::is_promise] [indexterm1 boost_asio.indexterm.experimental__is_promise..experimental::is_promise] @@ -100092,11 +101678,45 @@ Whether or not the coroutine is noexcept. [endsect] - [section:experimental__make_parallel_group experimental::make_parallel_group] [indexterm1 boost_asio.indexterm.experimental__make_parallel_group..experimental::make_parallel_group] +Create a group of operations that may be launched in parallel. + + template< + typename... Ops> + parallel_group< Ops...> ``[link boost_asio.reference.experimental__make_parallel_group.overload1 make_parallel_group]``( + Ops... ops); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload1 more...]]`` + + template< + typename Range> + ranged_parallel_group< typename std::decay< Range >::type > ``[link boost_asio.reference.experimental__make_parallel_group.overload2 make_parallel_group]``( + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload2 more...]]`` + + template< + typename Allocator, + typename Range> + ranged_parallel_group< typename std::decay< Range >::type, Allocator > ``[link boost_asio.reference.experimental__make_parallel_group.overload3 make_parallel_group]``( + allocator_arg_t , + const Allocator & allocator, + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__make_parallel_group.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/experimental/parallel_group.hpp] + +['Convenience header: ]None + + +[section:overload1 experimental::make_parallel_group (1 of 3 overloads)] + + Create a group of operations that may be launched in parallel. @@ -100144,16 +101764,167 @@ For example: -[heading Requirements] -['Header: ][^boost/asio/experimental/parallel_group.hpp] +[endsect] + + + +[section:overload2 experimental::make_parallel_group (2 of 3 overloads)] + + +Create a group of operations that may be launched in parallel. + + + template< + typename Range> + ranged_parallel_group< typename std::decay< Range >::type > make_parallel_group( + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + + + +[heading Parameters] + + +[variablelist + +[[range][A range containing the operations to be launched.]] + +] + +For example: + + using op_type = decltype( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + std::vector ops; + + ops.push_back( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + ops.push_back( + socket2.async_read_some( + boost::asio::buffer(data2), + boost::asio::deferred + ) + ); + + boost::asio::experimental::make_parallel_group(ops).async_wait( + boost::asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); + + + + + +[endsect] + + + +[section:overload3 experimental::make_parallel_group (3 of 3 overloads)] + + +Create a group of operations that may be launched in parallel. + + + template< + typename Allocator, + typename Range> + ranged_parallel_group< typename std::decay< Range >::type, Allocator > make_parallel_group( + allocator_arg_t , + const Allocator & allocator, + Range && range, + typename constraint< is_async_operation_range< typename std::decay< Range >::type >::value >::type = 0); + + + +[heading Parameters] + + +[variablelist + +[[allocator][Specifies the allocator to be used with the result vectors.]] + +[[range][A range containing the operations to be launched.]] + +] + +For example: + + using op_type = decltype( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + std::vector ops; + + ops.push_back( + socket1.async_read_some( + boost::asio::buffer(data1), + boost::asio::deferred + ) + ); + + ops.push_back( + socket2.async_read_some( + boost::asio::buffer(data2), + boost::asio::deferred + ) + ); + + boost::asio::experimental::make_parallel_group( + std::allocator_arg_t, + my_allocator, + ops + ).async_wait( + boost::asio::experimental::wait_for_all(), + []( + std::vector completion_order, + std::vector e, + std::vector n + ) + { + for (std::size_t i = 0; i < completion_order.size(); ++i) + { + std::size_t idx = completion_order[i]; + std::cout << "socket " << idx << " finished: "; + std::cout << e[idx] << ", " << n[idx] << "\n"; + } + } + ); + + -['Convenience header: ]None [endsect] +[endsect] + [section:experimental__parallel_group experimental::parallel_group] [indexterm1 boost_asio.indexterm.experimental__parallel_group..experimental::parallel_group] @@ -100309,112 +102080,85 @@ Class template `completion_signature_of` is a trait with a member type alias `ty [indexterm1 boost_asio.indexterm.experimental__promise..experimental::promise] -The primary template is not defined. +A disposable handle for an eager operation. template< typename Signature = void(), - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename ``[link boost_asio.reference.Executor1 Executor]`` = boost::asio::any_io_executor, + typename Allocator = std::allocator> struct promise -[heading Requirements] - -['Header: ][^boost/asio/experimental/promise.hpp] - -['Convenience header: ]None - - -[endsect] - -[section:experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_ experimental::promise< void(Ts...), Executor >] - -[indexterm1 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_..experimental::promise< void(Ts\.\.\.), Executor >] - - - - template< - typename... Ts, - typename ``[link boost_asio.reference.Executor1 Executor]``> - struct promise< void(Ts...), Executor > - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor [*promise< void(Ts...), Executor >::rebind_executor]]] - [Rebinds the promise type to another executor. ] - - ] - -] - [heading Member Functions] [table [[Name][Description]] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.async_wait [*async_wait]]] - [Wait for the promise to become ready. ] - ] - - [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.cancel [*cancel]]] + [[link boost_asio.reference.experimental__promise.cancel [*cancel]]] [Cancel the promise. Usually done through the destructor. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.complete [*complete]]] + [[link boost_asio.reference.experimental__promise.completed [*completed]]] [Check if the promise is completed already. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.get_executor [*get_executor]]] - [Get the executor of the promise. ] + [[link boost_asio.reference.experimental__promise.operator_lp__rp_ [*operator()]]] + [Wait for the promise to become ready. ] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise [*promise]]] + [[link boost_asio.reference.experimental__promise.promise [*promise]] [constructor]] [] ] [ - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_._promise [*~promise]] [destructor]] - [] + [[link boost_asio.reference.experimental__promise._promise [*~promise]] [destructor]] + [Destruct the promise and cancel the operation. ] ] ] -[heading Requirements] +Signature The signature of the operation. -['Header: ][^boost/asio/experimental/promise.hpp] +Executor The executor to be used by the promise (taken from the operation). -['Convenience header: ]None +Allocator The allocator used for the promise. Can be set through use\_allocator. +A promise can be used to initiate an asynchronous option that can be completed later. If the promise gets destroyed before completion, the operation gets a cancel signal and the result is ignored. -[section:async_wait experimental::promise< void(Ts...), Executor >::async_wait] +A promise fulfills the requirements of async\_operation. -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.async_wait..async_wait..experimental::promise< void(Ts\.\.\.), Executor >] -Wait for the promise to become ready. +[heading Examples] + +Reading and writing from one coroutine. - template< - typename CompletionToken = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``> - auto async_wait( - CompletionToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``); + awaitable read_write_some(boost::asio::ip::tcp::socket & sock, + boost::asio::mutable_buffer read_buf, boost::asio::const_buffer to_write) + { + auto p = boost::asio::async_read(read_buf, boost::asio::use_awaitable); + co_await boost::asio::async_write_some(to_write, boost::asio::deferred); + co_await p; + } -[endsect] -[section:cancel experimental::promise< void(Ts...), Executor >::cancel] +[heading Requirements] + +['Header: ][^boost/asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[section:cancel experimental::promise::cancel] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.cancel..cancel..experimental::promise< void(Ts\.\.\.), Executor >] +[indexterm2 boost_asio.indexterm.experimental__promise.cancel..cancel..experimental::promise] Cancel the promise. Usually done through the destructor. @@ -100427,13 +102171,13 @@ Cancel the promise. Usually done through the destructor. -[section:complete experimental::promise< void(Ts...), Executor >::complete] +[section:completed experimental::promise::completed] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.complete..complete..experimental::promise< void(Ts\.\.\.), Executor >] +[indexterm2 boost_asio.indexterm.experimental__promise.completed..completed..experimental::promise] Check if the promise is completed already. - bool complete() const; + bool completed() const; @@ -100441,36 +102185,39 @@ Check if the promise is completed already. -[section:get_executor experimental::promise< void(Ts...), Executor >::get_executor] +[section:operator_lp__rp_ experimental::promise::operator()] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.get_executor..get_executor..experimental::promise< void(Ts\.\.\.), Executor >] -Get the executor of the promise. +[indexterm2 boost_asio.indexterm.experimental__promise.operator_lp__rp_..operator()..experimental::promise] +Wait for the promise to become ready. - executor_type get_executor() const; + template< + typename CompletionToken> + ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` operator()( + CompletionToken && token); [endsect] -[section:promise experimental::promise< void(Ts...), Executor >::promise] +[section:promise experimental::promise::promise] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise..promise..experimental::promise< void(Ts\.\.\.), Executor >] +[indexterm2 boost_asio.indexterm.experimental__promise.promise..promise..experimental::promise] - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload1 promise]``(); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload1 more...]]`` + ``[link boost_asio.reference.experimental__promise.promise.overload1 promise]``(); + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload1 more...]]`` - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload2 promise]``( + ``[link boost_asio.reference.experimental__promise.promise.overload2 promise]``( const promise & ); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload2 more...]]`` + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload2 more...]]`` - ``[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload3 promise]``( + ``[link boost_asio.reference.experimental__promise.promise.overload3 promise]``( promise && ); - `` [''''»''' [link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_.promise.overload3 more...]]`` + `` [''''»''' [link boost_asio.reference.experimental__promise.promise.overload3 more...]]`` -[section:overload1 experimental::promise< void(Ts...), Executor >::promise (1 of 3 overloads)] +[section:overload1 experimental::promise::promise (1 of 3 overloads)] @@ -100482,7 +102229,7 @@ Get the executor of the promise. -[section:overload2 experimental::promise< void(Ts...), Executor >::promise (2 of 3 overloads)] +[section:overload2 experimental::promise::promise (2 of 3 overloads)] @@ -100495,7 +102242,7 @@ Get the executor of the promise. -[section:overload3 experimental::promise< void(Ts...), Executor >::promise (3 of 3 overloads)] +[section:overload3 experimental::promise::promise (3 of 3 overloads)] @@ -100510,13 +102257,17 @@ Get the executor of the promise. [endsect] -[section:_promise experimental::promise< void(Ts...), Executor >::~promise] +[section:_promise experimental::promise::~promise] + +[indexterm2 boost_asio.indexterm.experimental__promise._promise..~promise..experimental::promise] +Destruct the promise and cancel the operation. -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt_._promise..~promise..experimental::promise< void(Ts\.\.\.), Executor >] ~promise(); +It is safe to destruct a promise of a promise that didn't complete. + [endsect] @@ -100524,31 +102275,36 @@ Get the executor of the promise. [endsect] -[section:experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor experimental::promise< void(Ts...), Executor >::rebind_executor] - -[indexterm1 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor..experimental::promise< void(Ts\.\.\.), Executor >::rebind_executor] +[section:experimental__promise_value_type experimental::promise_value_type] +[indexterm1 boost_asio.indexterm.experimental__promise_value_type..experimental::promise_value_type] -Rebinds the promise type to another executor. template< - typename ``[link boost_asio.reference.Executor1 Executor1]``> - struct promise< void(Ts...), Executor >::rebind_executor + typename... Ts> + struct promise_value_type -[heading Types] -[table - [[Name][Description]] +[heading Requirements] - [ +['Header: ][^boost/asio/experimental/promise.hpp] + +['Convenience header: ]None + + +[endsect] + +[section:experimental__promise_value_type_lt__T__gt_ experimental::promise_value_type< T >] + +[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__T__gt_..experimental::promise_value_type< T >] - [[link boost_asio.reference.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor.other [*other]]] - [The file type when rebound to the specified executor. ] - - ] -] + + template< + typename T> + struct promise_value_type< T > + [heading Requirements] @@ -100557,15 +102313,17 @@ Rebinds the promise type to another executor. ['Convenience header: ]None -[section:other experimental::promise< void(Ts...), Executor >::rebind_executor::other] +[endsect] -[indexterm2 boost_asio.indexterm.experimental__promise_lt__void_lp_Ts_ellipsis__rp__comma__Executor__gt___rebind_executor.other..other..experimental::promise< void(Ts\.\.\.), Executor >::rebind_executor] -The file type when rebound to the specified executor. +[section:experimental__promise_value_type_lt__gt_ experimental::promise_value_type<>] +[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__gt_..experimental::promise_value_type<>] - typedef promise< void(Ts...), Executor1 > other; + template<> + struct promise_value_type<> + [heading Requirements] @@ -100576,67 +102334,141 @@ The file type when rebound to the specified executor. [endsect] +[section:experimental__ranged_parallel_group experimental::ranged_parallel_group] +[indexterm1 boost_asio.indexterm.experimental__ranged_parallel_group..experimental::ranged_parallel_group] -[endsect] -[section:experimental__promise_value_type experimental::promise_value_type] +A range-based group of asynchronous operations that may be launched in parallel. -[indexterm1 boost_asio.indexterm.experimental__promise_value_type..experimental::promise_value_type] + template< + typename Range, + typename Allocator = std::allocator> + class ranged_parallel_group - template< - typename... Ts> - struct promise_value_type +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__ranged_parallel_group.signature [*signature]]] + [The completion signature for the group of operations. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + [ + [[link boost_asio.reference.experimental__ranged_parallel_group.async_wait [*async_wait]]] + [Initiate an asynchronous wait for the group of operations. ] + ] + + [ + [[link boost_asio.reference.experimental__ranged_parallel_group.ranged_parallel_group [*ranged_parallel_group]] [constructor]] + [Constructor. ] + ] + +] + +See the documentation for [link boost_asio.reference.experimental__make_parallel_group `experimental::make_parallel_group`] for a usage example. [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/parallel_group.hpp] ['Convenience header: ]None -[endsect] +[section:async_wait experimental::ranged_parallel_group::async_wait] -[section:experimental__promise_value_type_lt__T__gt_ experimental::promise_value_type< T >] +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.async_wait..async_wait..experimental::ranged_parallel_group] +Initiate an asynchronous wait for the group of operations. -[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__T__gt_..experimental::promise_value_type< T >] + template< + typename CancellationCondition, + typename CompletionToken> + ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` async_wait( + CancellationCondition cancellation_condition, + CompletionToken && token); - template< - typename T> - struct promise_value_type< T > +Launches the group and asynchronously waits for completion. -[heading Requirements] +[heading Parameters] + + +[variablelist + +[[cancellation_condition][A function object, called on completion of an operation within the group, that is used to determine whether to cancel the remaining operations. The function object is passed the arguments of the completed operation's handler. To trigger cancellation of the remaining operations, it must return a [link boost_asio.reference.cancellation_type `cancellation_type`] value other than `boost::asio::cancellation_type::none`.]] + +[[token][A [link boost_asio.overview.model.completion_tokens completion token] whose signature is comprised of a `std::vector` indicating the completion order of the operations, followed by a vector for each of the completion signature's arguments.]] + +] + +The library provides the following `cancellation_condition` types: + + +* [link boost_asio.reference.experimental__wait_for_all `experimental::wait_for_all`] + +* [link boost_asio.reference.experimental__wait_for_one `experimental::wait_for_one`] + +* [link boost_asio.reference.experimental__wait_for_one_error `experimental::wait_for_one_error`] + +* [link boost_asio.reference.experimental__wait_for_one_success `experimental::wait_for_one_success`] -['Header: ][^boost/asio/experimental/promise.hpp] -['Convenience header: ]None [endsect] -[section:experimental__promise_value_type_lt__gt_ experimental::promise_value_type<>] -[indexterm1 boost_asio.indexterm.experimental__promise_value_type_lt__gt_..experimental::promise_value_type<>] +[section:ranged_parallel_group experimental::ranged_parallel_group::ranged_parallel_group] +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.ranged_parallel_group..ranged_parallel_group..experimental::ranged_parallel_group] +Constructor. + + + ranged_parallel_group( + Range range, + const Allocator & allocator = Allocator()); + + + +[endsect] + + + +[section:signature experimental::ranged_parallel_group::signature] + +[indexterm2 boost_asio.indexterm.experimental__ranged_parallel_group.signature..signature..experimental::ranged_parallel_group] +The completion signature for the group of operations. + + + typedef detail::ranged_parallel_group_signature< typename completion_signature_of< typename std::decay< decltype(*std::declval< typename Range::iterator >))>::type >::type, Allocator >::type signature; - template<> - struct promise_value_type<> [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/parallel_group.hpp] ['Convenience header: ]None +[endsect] + + + [endsect] @@ -100667,11 +102499,11 @@ See the documentation for boost::asio::use\_coro\_t for a usage example. [indexterm1 boost_asio.indexterm.experimental__use_coro_t..experimental::use_coro_t] -A [link boost_asio.overview.model.completion_tokens completion token] that represents the currently executing resumable coroutine. +A [link boost_asio.overview.model.completion_tokens completion token] that creates another coro for the task completion. template< - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename Allocator = std::allocator> struct use_coro_t @@ -100679,6 +102511,13 @@ A [link boost_asio.overview.model.completion_tokens completion token] that repre [table [[Name][Description]] + [ + + [[link boost_asio.reference.experimental__use_coro_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + [ [[link boost_asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -100697,6 +102536,16 @@ A [link boost_asio.overview.model.completion_tokens completion token] that repre [Function helper to adapt an I/O object to use use_coro_t as its default completion token type. ] ] + [ + [[link boost_asio.reference.experimental__use_coro_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_coro_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + [ [[link boost_asio.reference.experimental__use_coro_t.use_coro_t [*use_coro_t]] [constructor]] [Default constructor. @@ -100719,7 +102568,9 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera -When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. +When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. + +Note that this token is not the most efficient (use `boost::asio::deferred` for that) but does provide type erasure, as it will always return a `coro`. [heading Requirements] @@ -100728,6 +102579,27 @@ When used with co\_await, the initiating function (`async_read_some` in the abov ['Convenience header: ]None +[section:allocator_type experimental::use_coro_t::allocator_type] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.allocator_type..allocator_type..experimental::use_coro_t] +The allocator type. The allocator is used when constructing the `std::promise` object for a given asynchronous operation. + + + typedef Allocator allocator_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_coro.hpp] + +['Convenience header: ]None + + +[endsect] + + + [section:as_default_on experimental::use_coro_t::as_default_on] [indexterm2 boost_asio.indexterm.experimental__use_coro_t.as_default_on..as_default_on..experimental::use_coro_t] @@ -100741,6 +102613,37 @@ Function helper to adapt an I/O object to use `use_coro_t` as its default comple +[endsect] + + + +[section:get_allocator experimental::use_coro_t::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.get_allocator..get_allocator..experimental::use_coro_t] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:rebind experimental::use_coro_t::rebind] + +[indexterm2 boost_asio.indexterm.experimental__use_coro_t.rebind..rebind..experimental::use_coro_t] +Specify an alternate allocator. + + + template< + typename OtherAllocator> + use_coro_t< OtherAllocator > rebind( + const OtherAllocator & allocator) const; + + + [endsect] @@ -100856,6 +102759,13 @@ Specify `use_coro_t` as the default completion token type. [table [[Name][Description]] + [ + + [[link boost_asio.reference.experimental__use_coro_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + [ [[link boost_asio.reference.experimental__use_coro_t__executor_with_default [*executor_with_default]]] @@ -100874,6 +102784,16 @@ Specify `use_coro_t` as the default completion token type. [Function helper to adapt an I/O object to use use_coro_t as its default completion token type. ] ] + [ + [[link boost_asio.reference.experimental__use_coro_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_coro_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + [ [[link boost_asio.reference.experimental__use_coro_t.use_coro_t [*use_coro_t]] [constructor]] [Default constructor. @@ -100896,7 +102816,9 @@ The `use_coro_t` class, with its value `use_coro`, is used to represent an opera -When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. +When used with co\_await, the initiating function (`async_read_some` in the above example) suspends the current coroutine. The coroutine is resumed when the asynchronous operation completes, and the result of the operation is returned. + +Note that this token is not the most efficient (use `boost::asio::deferred` for that) but does provide type erasure, as it will always return a `coro`. [heading Requirements] @@ -100941,7 +102863,7 @@ Construct the adapted executor from the inner executor type. [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/use_promise.hpp] ['Convenience header: ]None @@ -100956,17 +102878,355 @@ Construct the adapted executor from the inner executor type. template< - typename ``[link boost_asio.reference.Executor1 Executor]`` = any_io_executor> + typename Allocator = std::allocator> struct use_promise_t +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the promise object for a given asynchronous operation. ] + + ] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default [*executor_with_default]]] + [Adapts an executor to add the use_promise_t completion token as the default. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t.as_default_on [*as_default_on]] [static]] + [Function helper to adapt an I/O object to use use_promise_t as its default completion token type. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.use_promise_t [*use_promise_t]] [constructor]] + [Construct using default-constructed allocator. + [hr] + Construct using specified allocator. ] + ] + +] + [heading Requirements] -['Header: ][^boost/asio/experimental/promise.hpp] +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[section:allocator_type experimental::use_promise_t::allocator_type] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.allocator_type..allocator_type..experimental::use_promise_t] +The allocator type. The allocator is used when constructing the `promise` object for a given asynchronous operation. + + + typedef Allocator allocator_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:as_default_on experimental::use_promise_t::as_default_on] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.as_default_on..as_default_on..experimental::use_promise_t] +Function helper to adapt an I/O object to use `use_promise_t` as its default completion token type. + + + template< + typename T> + static decay< T >::type::template rebind_executor< executor_with_default< typename decay< T >::type::executor_type > >::other as_default_on( + T && object); + + + +[endsect] + + + +[section:get_allocator experimental::use_promise_t::get_allocator] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.get_allocator..get_allocator..experimental::use_promise_t] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + + +[section:rebind experimental::use_promise_t::rebind] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.rebind..rebind..experimental::use_promise_t] +Specify an alternate allocator. + + + template< + typename OtherAllocator> + use_promise_t< OtherAllocator > rebind( + const OtherAllocator & allocator) const; + + + +[endsect] + + +[section:use_promise_t experimental::use_promise_t::use_promise_t] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t.use_promise_t..use_promise_t..experimental::use_promise_t] +Construct using default-constructed allocator. + + + constexpr ``[link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload1 use_promise_t]``(); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload1 more...]]`` + + +Construct using specified allocator. + + + explicit ``[link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload2 use_promise_t]``( + const Allocator & allocator); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t.use_promise_t.overload2 more...]]`` + + +[section:overload1 experimental::use_promise_t::use_promise_t (1 of 2 overloads)] + + +Construct using default-constructed allocator. + + + constexpr use_promise_t(); + + + +[endsect] + + + +[section:overload2 experimental::use_promise_t::use_promise_t (2 of 2 overloads)] + + +Construct using specified allocator. + + + use_promise_t( + const Allocator & allocator); + + + +[endsect] + + +[endsect] + + +[endsect] + +[section:experimental__use_promise_t__executor_with_default experimental::use_promise_t::executor_with_default] + +[indexterm1 boost_asio.indexterm.experimental__use_promise_t__executor_with_default..experimental::use_promise_t::executor_with_default] + + +Adapts an executor to add the `use_promise_t` completion token as the default. + + + template< + typename ``[link boost_asio.reference.Executor1 InnerExecutor]``> + struct executor_with_default + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default.default_completion_token_type [*default_completion_token_type]]] + [Specify use_promise_t as the default completion token type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default [*executor_with_default]] [constructor]] + [Construct the adapted executor from the inner executor type. + [hr] + Convert the specified executor to the inner executor type, then use that to construct the adapted executor. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] ['Convenience header: ]None +[section:default_completion_token_type experimental::use_promise_t::executor_with_default::default_completion_token_type] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t__executor_with_default.default_completion_token_type..default_completion_token_type..experimental::use_promise_t::executor_with_default] +Specify `use_promise_t` as the default completion token type. + + + typedef use_promise_t< Allocator > default_completion_token_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.experimental__use_promise_t.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the promise object for a given asynchronous operation. ] + + ] + + [ + + [[link boost_asio.reference.experimental__use_promise_t__executor_with_default [*executor_with_default]]] + [Adapts an executor to add the use_promise_t completion token as the default. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.experimental__use_promise_t.as_default_on [*as_default_on]] [static]] + [Function helper to adapt an I/O object to use use_promise_t as its default completion token type. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.rebind [*rebind]]] + [Specify an alternate allocator. ] + ] + + [ + [[link boost_asio.reference.experimental__use_promise_t.use_promise_t [*use_promise_t]] [constructor]] + [Construct using default-constructed allocator. + [hr] + Construct using specified allocator. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/experimental/use_promise.hpp] + +['Convenience header: ]None + + +[endsect] + + +[section:executor_with_default experimental::use_promise_t::executor_with_default::executor_with_default] + +[indexterm2 boost_asio.indexterm.experimental__use_promise_t__executor_with_default.executor_with_default..executor_with_default..experimental::use_promise_t::executor_with_default] +Construct the adapted executor from the inner executor type. + + + ``[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload1 executor_with_default]``( + const InnerExecutor & ex); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload1 more...]]`` + + +Convert the specified executor to the inner executor type, then use that to construct the adapted executor. + + + template< + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 executor_with_default]``( + const OtherExecutor & ex, + typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.experimental__use_promise_t__executor_with_default.executor_with_default.overload2 more...]]`` + + +[section:overload1 experimental::use_promise_t::executor_with_default::executor_with_default (1 of 2 overloads)] + + +Construct the adapted executor from the inner executor type. + + + executor_with_default( + const InnerExecutor & ex); + + + +[endsect] + + + +[section:overload2 experimental::use_promise_t::executor_with_default::executor_with_default (2 of 2 overloads)] + + +Convert the specified executor to the inner executor type, then use that to construct the adapted executor. + + + template< + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + executor_with_default( + const OtherExecutor & ex, + typename constraint< is_convertible< OtherExecutor, InnerExecutor >::value >::type = 0); + + + +[endsect] + + +[endsect] + + [endsect] [section:experimental__wait_for_all experimental::wait_for_all] @@ -105784,7 +108044,7 @@ Helper function to obtain an object's associated executor. template< typename T, typename ExecutionContext> - auto ``[link boost_asio.reference.get_associated_executor.overload3 get_associated_executor]``( + associated_executor< T, typename ExecutionContext::executor_type >::type ``[link boost_asio.reference.get_associated_executor.overload3 get_associated_executor]``( const T & t, ExecutionContext & ctx, typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); @@ -105857,7 +108117,7 @@ Helper function to obtain an object's associated executor. template< typename T, typename ExecutionContext> - auto get_associated_executor( + associated_executor< T, typename ExecutionContext::executor_type >::type get_associated_executor( const T & t, ExecutionContext & ctx, typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); @@ -105871,6 +108131,92 @@ Helper function to obtain an object's associated executor. +[endsect] + + +[endsect] + +[section:get_associated_immediate_executor get_associated_immediate_executor] + +[indexterm1 boost_asio.indexterm.get_associated_immediate_executor..get_associated_immediate_executor] + +Helper function to obtain an object's associated executor. + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + auto ``[link boost_asio.reference.get_associated_immediate_executor.overload1 get_associated_immediate_executor]``( + const T & t, + const Executor & ex, + typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.get_associated_immediate_executor.overload1 more...]]`` + + template< + typename T, + typename ExecutionContext> + associated_immediate_executor< T, typename ExecutionContext::executor_type >::type ``[link boost_asio.reference.get_associated_immediate_executor.overload2 get_associated_immediate_executor]``( + const T & t, + ExecutionContext & ctx, + typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + `` [''''»''' [link boost_asio.reference.get_associated_immediate_executor.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/associated_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 get_associated_immediate_executor (1 of 2 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + auto get_associated_immediate_executor( + const T & t, + const Executor & ex, + typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type = 0); + + + +[heading Return Value] + +`associated_immediate_executor::get(t, ex)` + + + + +[endsect] + + + +[section:overload2 get_associated_immediate_executor (2 of 2 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ExecutionContext> + associated_immediate_executor< T, typename ExecutionContext::executor_type >::type get_associated_immediate_executor( + const T & t, + ExecutionContext & ctx, + typename constraint< is_convertible< ExecutionContext &, execution_context & >::value >::type = 0); + + + +[heading Return Value] + +`associated_immediate_executorget(t, ctx.get_executor())` + + + + [endsect] @@ -106134,6 +108480,675 @@ This typedef uses the C++11 `` standard library facility, if available. [endsect] +[section:immediate_executor_binder immediate_executor_binder] + +[indexterm1 boost_asio.indexterm.immediate_executor_binder..immediate_executor_binder] + + +A call wrapper type to bind a immediate executor of type `Executor` to an object of type `T`. + + + template< + typename T, + typename ``[link boost_asio.reference.Executor1 Executor]``> + class immediate_executor_binder + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.immediate_executor_binder.argument_type [*argument_type]]] + [The type of the function's argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.first_argument_type [*first_argument_type]]] + [The type of the function's first argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.immediate_executor_type [*immediate_executor_type]]] + [The type of the associated immediate executor. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.result_type [*result_type]]] + [The return type if a function. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.second_argument_type [*second_argument_type]]] + [The type of the function's second argument. ] + + ] + + [ + + [[link boost_asio.reference.immediate_executor_binder.target_type [*target_type]]] + [The type of the target object. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.immediate_executor_binder.get [*get]]] + [Obtain a reference to the target object. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.get_immediate_executor [*get_immediate_executor]]] + [Obtain the associated immediate executor. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder [*immediate_executor_binder]] [constructor]] + [Construct a immediate executor wrapper for the specified object. + [hr] + Copy constructor. + [hr] + Construct a copy, but specify a different immediate executor. + [hr] + Construct a copy of a different immediate executor wrapper type. + [hr] + Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + [hr] + Move constructor. + [hr] + Move construct the target object, but specify a different immediate executor. + [hr] + Move construct from a different immediate executor wrapper type. + [hr] + Move construct from a different immediate executor wrapper type, but specify a different immediate executor. ] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_ [*operator()]]] + [] + ] + + [ + [[link boost_asio.reference.immediate_executor_binder._immediate_executor_binder [*~immediate_executor_binder]] [destructor]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:argument_type immediate_executor_binder::argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.argument_type..argument_type..immediate_executor_binder] +The type of the function's argument. + + + typedef see_below argument_type; + + + +The type of `argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting a single argument, `argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `argument_type`, then `argument_type` is a synonym for `T::argument_type`; + + +* otherwise `argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:first_argument_type immediate_executor_binder::first_argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.first_argument_type..first_argument_type..immediate_executor_binder] +The type of the function's first argument. + + + typedef see_below first_argument_type; + + + +The type of `first_argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting two arguments, `first_argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `first_argument_type`, then `first_argument_type` is a synonym for `T::first_argument_type`; + + +* otherwise `first_argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:get immediate_executor_binder::get] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.get..get..immediate_executor_binder] +Obtain a reference to the target object. + + + target_type & ``[link boost_asio.reference.immediate_executor_binder.get.overload1 get]``(); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.get.overload1 more...]]`` + + const target_type & ``[link boost_asio.reference.immediate_executor_binder.get.overload2 get]``() const; + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.get.overload2 more...]]`` + + +[section:overload1 immediate_executor_binder::get (1 of 2 overloads)] + + +Obtain a reference to the target object. + + + target_type & get(); + + + +[endsect] + + + +[section:overload2 immediate_executor_binder::get (2 of 2 overloads)] + + +Obtain a reference to the target object. + + + const target_type & get() const; + + + +[endsect] + + +[endsect] + + +[section:get_immediate_executor immediate_executor_binder::get_immediate_executor] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.get_immediate_executor..get_immediate_executor..immediate_executor_binder] +Obtain the associated immediate executor. + + + immediate_executor_type get_immediate_executor() const; + + + +[endsect] + + +[section:immediate_executor_binder immediate_executor_binder::immediate_executor_binder] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.immediate_executor_binder..immediate_executor_binder..immediate_executor_binder] +Construct a immediate executor wrapper for the specified object. + + + template< + typename U> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload1 immediate_executor_binder]``( + const immediate_executor_type & e, + U && u); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload1 more...]]`` + + +Copy constructor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload2 immediate_executor_binder]``( + const immediate_executor_binder & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload2 more...]]`` + + +Construct a copy, but specify a different immediate executor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload3 immediate_executor_binder]``( + const immediate_executor_type & e, + const immediate_executor_binder & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload3 more...]]`` + + +Construct a copy of a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload4 immediate_executor_binder]``( + const immediate_executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload4 more...]]`` + + +Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload5 immediate_executor_binder]``( + const immediate_executor_type & e, + const immediate_executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload5 more...]]`` + + +Move constructor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload6 immediate_executor_binder]``( + immediate_executor_binder && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload6 more...]]`` + + +Move construct the target object, but specify a different immediate executor. + + + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload7 immediate_executor_binder]``( + const immediate_executor_type & e, + immediate_executor_binder && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload7 more...]]`` + + +Move construct from a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload8 immediate_executor_binder]``( + immediate_executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload8 more...]]`` + + +Move construct from a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload9 immediate_executor_binder]``( + const immediate_executor_type & e, + immediate_executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.immediate_executor_binder.overload9 more...]]`` + + +[section:overload1 immediate_executor_binder::immediate_executor_binder (1 of 9 overloads)] + + +Construct a immediate executor wrapper for the specified object. + + + template< + typename U> + immediate_executor_binder( + const immediate_executor_type & e, + U && u); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload2 immediate_executor_binder::immediate_executor_binder (2 of 9 overloads)] + + +Copy constructor. + + + immediate_executor_binder( + const immediate_executor_binder & other); + + + +[endsect] + + + +[section:overload3 immediate_executor_binder::immediate_executor_binder (3 of 9 overloads)] + + +Construct a copy, but specify a different immediate executor. + + + immediate_executor_binder( + const immediate_executor_type & e, + const immediate_executor_binder & other); + + + +[endsect] + + + +[section:overload4 immediate_executor_binder::immediate_executor_binder (4 of 9 overloads)] + + +Construct a copy of a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_binder< U, OtherExecutor > & other); + + +This constructor is only valid if the `Executor` type is constructible from type `OtherExecutor`, and the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload5 immediate_executor_binder::immediate_executor_binder (5 of 9 overloads)] + + +Construct a copy of a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_type & e, + const immediate_executor_binder< U, OtherExecutor > & other); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload6 immediate_executor_binder::immediate_executor_binder (6 of 9 overloads)] + + +Move constructor. + + + immediate_executor_binder( + immediate_executor_binder && other); + + + +[endsect] + + + +[section:overload7 immediate_executor_binder::immediate_executor_binder (7 of 9 overloads)] + + +Move construct the target object, but specify a different immediate executor. + + + immediate_executor_binder( + const immediate_executor_type & e, + immediate_executor_binder && other); + + + +[endsect] + + + +[section:overload8 immediate_executor_binder::immediate_executor_binder (8 of 9 overloads)] + + +Move construct from a different immediate executor wrapper type. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + immediate_executor_binder< U, OtherExecutor > && other); + + + +[endsect] + + + +[section:overload9 immediate_executor_binder::immediate_executor_binder (9 of 9 overloads)] + + +Move construct from a different immediate executor wrapper type, but specify a different immediate executor. + + + template< + typename U, + typename ``[link boost_asio.reference.Executor1 OtherExecutor]``> + immediate_executor_binder( + const immediate_executor_type & e, + immediate_executor_binder< U, OtherExecutor > && other); + + + +[endsect] + + +[endsect] + + +[section:immediate_executor_type immediate_executor_binder::immediate_executor_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.immediate_executor_type..immediate_executor_type..immediate_executor_binder] +The type of the associated immediate executor. + + + typedef Executor immediate_executor_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:operator_lp__rp_ immediate_executor_binder::operator()] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.operator_lp__rp_..operator()..immediate_executor_binder] + + template< + typename... Args> + auto ``[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 operator()]``( + Args && ...); + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload1 more...]]`` + + template< + typename... Args> + auto ``[link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 operator()]``( + Args && ...) const; + `` [''''»''' [link boost_asio.reference.immediate_executor_binder.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 immediate_executor_binder::operator() (1 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...); + + + +[endsect] + + + +[section:overload2 immediate_executor_binder::operator() (2 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...) const; + + + +[endsect] + + +[endsect] + + +[section:result_type immediate_executor_binder::result_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.result_type..result_type..immediate_executor_binder] +The return type if a function. + + + typedef see_below result_type; + + + +The type of `result_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to function type, `result_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `result_type`, then `result_type` is a synonym for `T::result_type`; + + +* otherwise `result_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:second_argument_type immediate_executor_binder::second_argument_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.second_argument_type..second_argument_type..immediate_executor_binder] +The type of the function's second argument. + + + typedef see_below second_argument_type; + + + +The type of `second_argument_type` is based on the type `T` of the wrapper's target object: + + +* if `T` is a pointer to a function type accepting two arguments, `second_argument_type` is a synonym for the return type of `T`; + + +* if `T` is a class type with a member type `first_argument_type`, then `second_argument_type` is a synonym for `T::second_argument_type`; + + +* otherwise `second_argument_type` is not defined. + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:target_type immediate_executor_binder::target_type] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder.target_type..target_type..immediate_executor_binder] +The type of the target object. + + + typedef T target_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/bind_immediate_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:_immediate_executor_binder immediate_executor_binder::~immediate_executor_binder] + +[indexterm2 boost_asio.indexterm.immediate_executor_binder._immediate_executor_binder..~immediate_executor_binder..immediate_executor_binder] +Destructor. + + + ~immediate_executor_binder(); + + + +[endsect] + + + +[endsect] + [section:invalid_service_owner invalid_service_owner] [indexterm1 boost_asio.indexterm.invalid_service_owner..invalid_service_owner] @@ -129558,7 +132573,1085 @@ The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] cl [heading Requirements] -['Header: ][^boost/asio/local/datagram_protocol.hpp] +['Header: ][^boost/asio/local/datagram_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:family local::datagram_protocol::family] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.family..family..local::datagram_protocol] +Obtain an identifier for the protocol family. + + + int family() const; + + + +[endsect] + + + +[section:protocol local::datagram_protocol::protocol] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.protocol..protocol..local::datagram_protocol] +Obtain an identifier for the protocol. + + + int protocol() const; + + + +[endsect] + + + +[section:socket local::datagram_protocol::socket] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.socket..socket..local::datagram_protocol] +The UNIX domain socket type. + + + typedef basic_datagram_socket< datagram_protocol > socket; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.basic_datagram_socket__rebind_executor [*rebind_executor]]] + [Rebinds the socket type to another executor. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]] + [Socket option to permit sending of broadcast messages. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]] + [IO control command to get the amount of data that can be read without blocking. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]] + [Socket option to enable socket-level debugging. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]] + [Socket option to prevent routing, use local interfaces only. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]] + [Socket option to report aborted connections on accept. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]] + [The endpoint type. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]] + [Socket option to send keep-alives. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]] + [Socket option to specify whether the socket lingers on close if unsent data is present. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]] + [A basic_socket is always the lowest layer. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]] + [Bitmask type for flags that can be passed to send and receive operations. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]] + [The native representation of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.out_of_band_inline [*out_of_band_inline]]] + [Socket option for putting received out-of-band data inline. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] + [The protocol type. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]] + [Socket option for the receive buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]] + [Socket option for the receive low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]] + [Socket option to allow the socket to be bound to an address that is already in use. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]] + [Socket option for the send buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]] + [Socket option for the send low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]] + [Different ways a socket may be shutdown. ] + + ] + + [ + + [[link boost_asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]] + [Assign an existing native socket to the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]] + [Start an asynchronous connect. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]] + [Start an asynchronous receive on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]] + [Start an asynchronous receive. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]] + [Start an asynchronous send on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]] + [Start an asynchronous send. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]] + [Determine whether the socket is at the out-of-band data mark. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.available [*available]]] + [Determine the number of bytes available for reading. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]] [constructor]] + [Construct a basic_datagram_socket without opening it. + [hr] + Construct and open a basic_datagram_socket. + [hr] + Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. + [hr] + Construct a basic_datagram_socket on an existing native socket. + [hr] + Move-construct a basic_datagram_socket from another. + [hr] + Move-construct a basic_datagram_socket from a socket of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]] + [Bind the socket to the given local endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]] + [Cancel all asynchronous operations associated with the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.close [*close]]] + [Close the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]] + [Connect the socket to the specified endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]] + [Get an option from the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]] + [Perform an IO control command on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]] + [Determine whether the socket is open. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]] + [Get the local endpoint of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]] + [Get a reference to the lowest layer. + [hr] + Get a const reference to the lowest layer. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]] + [Get the native socket representation. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]] + [Gets the non-blocking mode of the native socket implementation. + [hr] + Sets the non-blocking mode of the native socket implementation. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]] + [Gets the non-blocking mode of the socket. + [hr] + Sets the non-blocking mode of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.open [*open]]] + [Open the socket using the specified protocol. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.operator_eq_ [*operator=]]] + [Move-assign a basic_datagram_socket from another. + [hr] + Move-assign a basic_datagram_socket from a socket of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]] + [Receive some data on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]] + [Receive a datagram with the endpoint of the sender. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.release [*release]]] + [Release ownership of the underlying native socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]] + [Get the remote endpoint of the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.send [*send]]] + [Send some data on a connected socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]] + [Send a datagram to the specified endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]] + [Set an option on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]] + [Disable sends or receives on the socket. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket._basic_datagram_socket [*~basic_datagram_socket]] [destructor]] + [Destroys the socket. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]] [static]] + [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.max_listen_connections [*max_listen_connections]] [static]] + [The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]] [static]] + [Specify that the data should not be subject to routing. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]] [static]] + [Specifies that the data marks the end of a record. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]] [static]] + [Process out-of-band data. ] + ] + + [ + [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]] [static]] + [Peek at incoming data without removing it from the input queue. ] + ] + +] + +The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + +Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. + + +[heading Requirements] + +['Header: ][^boost/asio/local/datagram_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:type local::datagram_protocol::type] + +[indexterm2 boost_asio.indexterm.local__datagram_protocol.type..type..local::datagram_protocol] +Obtain an identifier for the type of the protocol. + + + int type() const; + + + +[endsect] + + + +[endsect] + +[section:local__seq_packet_protocol local::seq_packet_protocol] + +[indexterm1 boost_asio.indexterm.local__seq_packet_protocol..local::seq_packet_protocol] + + +Encapsulates the flags needed for seq\_packet UNIX sockets. + + + class seq_packet_protocol + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.acceptor [*acceptor]]] + [The UNIX domain acceptor type. ] + + ] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.endpoint [*endpoint]]] + [The type of a UNIX domain endpoint. ] + + ] + + [ + + [[link boost_asio.reference.local__seq_packet_protocol.socket [*socket]]] + [The UNIX domain socket type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.family [*family]]] + [Obtain an identifier for the protocol family. ] + ] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.protocol [*protocol]]] + [Obtain an identifier for the protocol. ] + ] + + [ + [[link boost_asio.reference.local__seq_packet_protocol.type [*type]]] + [Obtain an identifier for the type of the protocol. ] + ] + +] + +The [link boost_asio.reference.local__seq_packet_protocol `local::seq_packet_protocol`] class contains flags necessary for sequenced packet UNIX domain sockets. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Safe. + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:acceptor local::seq_packet_protocol::acceptor] + +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.acceptor..acceptor..local::seq_packet_protocol] +The UNIX domain acceptor type. + + + typedef basic_socket_acceptor< seq_packet_protocol > acceptor; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.basic_socket_acceptor__rebind_executor [*rebind_executor]]] + [Rebinds the acceptor type to another executor. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]] + [Socket option to permit sending of broadcast messages. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]] + [IO control command to get the amount of data that can be read without blocking. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]] + [Socket option to enable socket-level debugging. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]] + [Socket option to prevent routing, use local interfaces only. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]] + [Socket option to report aborted connections on accept. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]] + [The endpoint type. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]] + [Socket option to send keep-alives. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]] + [Socket option to specify whether the socket lingers on close if unsent data is present. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]] + [Bitmask type for flags that can be passed to send and receive operations. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.native_handle_type [*native_handle_type]]] + [The native representation of an acceptor. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.out_of_band_inline [*out_of_band_inline]]] + [Socket option for putting received out-of-band data inline. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]] + [The protocol type. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]] + [Socket option for the receive buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]] + [Socket option for the receive low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]] + [Socket option to allow the socket to be bound to an address that is already in use. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]] + [Socket option for the send buffer size of a socket. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]] + [Socket option for the send low watermark. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]] + [Different ways a socket may be shutdown. ] + + ] + + [ + + [[link boost_asio.reference.basic_socket_acceptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]] + [Accept a new connection. + [hr] + Accept a new connection and obtain the endpoint of the peer. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]] + [Assigns an existing native acceptor to the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]] + [Start an asynchronous accept. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.async_wait [*async_wait]]] + [Asynchronously wait for the acceptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]] [constructor]] + [Construct an acceptor without opening it. + [hr] + Construct an open acceptor. + [hr] + Construct an acceptor opened on the given endpoint. + [hr] + Construct a basic_socket_acceptor on an existing native acceptor. + [hr] + Move-construct a basic_socket_acceptor from another. + [hr] + Move-construct a basic_socket_acceptor from an acceptor of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]] + [Bind the acceptor to the given local endpoint. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]] + [Cancel all asynchronous operations associated with the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.close [*close]]] + [Close the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]] + [Get an option from the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.io_control [*io_control]]] + [Perform an IO control command on the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]] + [Determine whether the acceptor is open. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]] + [Place the acceptor into the state where it will listen for new connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]] + [Get the local endpoint of the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.native_handle [*native_handle]]] + [Get the native acceptor representation. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.native_non_blocking [*native_non_blocking]]] + [Gets the non-blocking mode of the native acceptor implementation. + [hr] + Sets the non-blocking mode of the native acceptor implementation. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.non_blocking [*non_blocking]]] + [Gets the non-blocking mode of the acceptor. + [hr] + Sets the non-blocking mode of the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.open [*open]]] + [Open the acceptor using the specified protocol. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.operator_eq_ [*operator=]]] + [Move-assign a basic_socket_acceptor from another. + [hr] + Move-assign a basic_socket_acceptor from an acceptor of another protocol type. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.release [*release]]] + [Release ownership of the underlying native acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]] + [Set an option on the acceptor. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.wait [*wait]]] + [Wait for the acceptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor._basic_socket_acceptor [*~basic_socket_acceptor]] [destructor]] + [Destroys the acceptor. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]] [static]] + [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.max_listen_connections [*max_listen_connections]] [static]] + [The maximum length of the queue of pending incoming connections. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]] [static]] + [Specify that the data should not be subject to routing. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_end_of_record [*message_end_of_record]] [static]] + [Specifies that the data marks the end of a record. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]] [static]] + [Process out-of-band data. ] + ] + + [ + [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]] [static]] + [Peek at incoming data without removing it from the input queue. ] + ] + +] + +The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + +Synchronous `accept` operations are thread safe, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to synchronous `accept` operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. + + +[heading Example] + +Opening a socket acceptor with the SO\_REUSEADDR option enabled: + + boost::asio::ip::tcp::acceptor acceptor(my_context); + boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port); + acceptor.open(endpoint.protocol()); + acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); + acceptor.bind(endpoint); + acceptor.listen(); + + + + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:endpoint local::seq_packet_protocol::endpoint] + +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.endpoint..endpoint..local::seq_packet_protocol] +The type of a UNIX domain endpoint. + + + typedef basic_endpoint< seq_packet_protocol > endpoint; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]] + [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ] + + ] + + [ + + [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]] + [The protocol type associated with the endpoint. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]] [constructor]] + [Default constructor. + [hr] + Construct an endpoint using the specified path name. + [hr] + Copy constructor. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]] + [Get the capacity of the endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.data [*data]]] + [Get the underlying endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]] + [Assign from another endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.path [*path]]] + [Get the path associated with the endpoint. + [hr] + Set the path associated with the endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]] + [The protocol associated with the endpoint. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]] + [Set the underlying size of the endpoint in the native type. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.size [*size]]] + [Get the underlying size of the endpoint in the native type. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]] + [Compare two endpoints for inequality. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]] + [Compare two endpoints for equality. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]] + [Compare endpoints for ordering. ] + ] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]] + [Compare endpoints for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]] + [Output an endpoint as a string. ] + ] + +] + +The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + + +[heading Requirements] + +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] ['Convenience header: ][^boost/asio.hpp] @@ -129567,9 +133660,9 @@ The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] cl -[section:family local::datagram_protocol::family] +[section:family local::seq_packet_protocol::family] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.family..family..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.family..family..local::seq_packet_protocol] Obtain an identifier for the protocol family. @@ -129581,9 +133674,9 @@ Obtain an identifier for the protocol family. -[section:protocol local::datagram_protocol::protocol] +[section:protocol local::seq_packet_protocol::protocol] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.protocol..protocol..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.protocol..protocol..local::seq_packet_protocol] Obtain an identifier for the protocol. @@ -129595,13 +133688,13 @@ Obtain an identifier for the protocol. -[section:socket local::datagram_protocol::socket] +[section:socket local::seq_packet_protocol::socket] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.socket..socket..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.socket..socket..local::seq_packet_protocol] The UNIX domain socket type. - typedef basic_datagram_socket< datagram_protocol > socket; + typedef basic_seq_packet_socket< seq_packet_protocol > socket; [heading Types] @@ -129610,154 +133703,154 @@ The UNIX domain socket type. [ - [[link boost_asio.reference.basic_datagram_socket__rebind_executor [*rebind_executor]]] + [[link boost_asio.reference.basic_seq_packet_socket__rebind_executor [*rebind_executor]]] [Rebinds the socket type to another executor. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]] + [[link boost_asio.reference.basic_seq_packet_socket.broadcast [*broadcast]]] [Socket option to permit sending of broadcast messages. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]] + [[link boost_asio.reference.basic_seq_packet_socket.bytes_readable [*bytes_readable]]] [IO control command to get the amount of data that can be read without blocking. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]] + [[link boost_asio.reference.basic_seq_packet_socket.debug [*debug]]] [Socket option to enable socket-level debugging. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]] + [[link boost_asio.reference.basic_seq_packet_socket.do_not_route [*do_not_route]]] [Socket option to prevent routing, use local interfaces only. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]] + [[link boost_asio.reference.basic_seq_packet_socket.enable_connection_aborted [*enable_connection_aborted]]] [Socket option to report aborted connections on accept. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.endpoint_type [*endpoint_type]]] [The endpoint type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.executor_type [*executor_type]]] [The type of the executor associated with the object. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]] + [[link boost_asio.reference.basic_seq_packet_socket.keep_alive [*keep_alive]]] [Socket option to send keep-alives. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]] + [[link boost_asio.reference.basic_seq_packet_socket.linger [*linger]]] [Socket option to specify whether the socket lingers on close if unsent data is present. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer_type [*lowest_layer_type]]] [A basic_socket is always the lowest layer. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]] + [[link boost_asio.reference.basic_seq_packet_socket.message_flags [*message_flags]]] [Bitmask type for flags that can be passed to send and receive operations. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_handle_type [*native_handle_type]]] [The native representation of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.out_of_band_inline [*out_of_band_inline]]] + [[link boost_asio.reference.basic_seq_packet_socket.out_of_band_inline [*out_of_band_inline]]] [Socket option for putting received out-of-band data inline. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.protocol_type [*protocol_type]]] [The protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]] + [[link boost_asio.reference.basic_seq_packet_socket.receive_buffer_size [*receive_buffer_size]]] [Socket option for the receive buffer size of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]] + [[link boost_asio.reference.basic_seq_packet_socket.receive_low_watermark [*receive_low_watermark]]] [Socket option for the receive low watermark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]] + [[link boost_asio.reference.basic_seq_packet_socket.reuse_address [*reuse_address]]] [Socket option to allow the socket to be bound to an address that is already in use. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]] + [[link boost_asio.reference.basic_seq_packet_socket.send_buffer_size [*send_buffer_size]]] [Socket option for the send buffer size of a socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]] + [[link boost_asio.reference.basic_seq_packet_socket.send_low_watermark [*send_low_watermark]]] [Socket option for the send low watermark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.shutdown_type [*shutdown_type]]] [Different ways a socket may be shutdown. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [[link boost_asio.reference.basic_seq_packet_socket.wait_type [*wait_type]]] [Wait types. ] ] @@ -129769,195 +133862,177 @@ The UNIX domain socket type. [[Name][Description]] [ - [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]] + [[link boost_asio.reference.basic_seq_packet_socket.assign [*assign]]] [Assign an existing native socket to the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_connect [*async_connect]]] [Start an asynchronous connect. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]] - [Start an asynchronous receive on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_receive [*async_receive]]] [Start an asynchronous receive. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]] - [Start an asynchronous send on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_send [*async_send]]] [Start an asynchronous send. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.async_wait [*async_wait]]] + [[link boost_asio.reference.basic_seq_packet_socket.async_wait [*async_wait]]] [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]] + [[link boost_asio.reference.basic_seq_packet_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.available [*available]]] + [[link boost_asio.reference.basic_seq_packet_socket.available [*available]]] [Determine the number of bytes available for reading. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]] [constructor]] - [Construct a basic_datagram_socket without opening it. + [[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket [*basic_seq_packet_socket]] [constructor]] + [Construct a basic_seq_packet_socket without opening it. [hr] - Construct and open a basic_datagram_socket. + Construct and open a basic_seq_packet_socket. [hr] - Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. + Construct a basic_seq_packet_socket, opening it and binding it to the given local endpoint. [hr] - Construct a basic_datagram_socket on an existing native socket. + Construct a basic_seq_packet_socket on an existing native socket. [hr] - Move-construct a basic_datagram_socket from another. + Move-construct a basic_seq_packet_socket from another. [hr] - Move-construct a basic_datagram_socket from a socket of another protocol type. ] + Move-construct a basic_seq_packet_socket from a socket of another protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]] + [[link boost_asio.reference.basic_seq_packet_socket.bind [*bind]]] [Bind the socket to the given local endpoint. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]] + [[link boost_asio.reference.basic_seq_packet_socket.cancel [*cancel]]] [Cancel all asynchronous operations associated with the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.close [*close]]] + [[link boost_asio.reference.basic_seq_packet_socket.close [*close]]] [Close the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]] + [[link boost_asio.reference.basic_seq_packet_socket.connect [*connect]]] [Connect the socket to the specified endpoint. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [[link boost_asio.reference.basic_seq_packet_socket.get_executor [*get_executor]]] [Get the executor associated with the object. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]] + [[link boost_asio.reference.basic_seq_packet_socket.get_option [*get_option]]] [Get an option from the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]] + [[link boost_asio.reference.basic_seq_packet_socket.io_control [*io_control]]] [Perform an IO control command on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]] + [[link boost_asio.reference.basic_seq_packet_socket.is_open [*is_open]]] [Determine whether the socket is open. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]] + [[link boost_asio.reference.basic_seq_packet_socket.local_endpoint [*local_endpoint]]] [Get the local endpoint of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]] + [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer [*lowest_layer]]] [Get a reference to the lowest layer. [hr] Get a const reference to the lowest layer. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]] + [[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking [*native_non_blocking]]] [Gets the non-blocking mode of the native socket implementation. [hr] Sets the non-blocking mode of the native socket implementation. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]] + [[link boost_asio.reference.basic_seq_packet_socket.non_blocking [*non_blocking]]] [Gets the non-blocking mode of the socket. [hr] Sets the non-blocking mode of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.open [*open]]] + [[link boost_asio.reference.basic_seq_packet_socket.open [*open]]] [Open the socket using the specified protocol. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.operator_eq_ [*operator=]]] - [Move-assign a basic_datagram_socket from another. + [[link boost_asio.reference.basic_seq_packet_socket.operator_eq_ [*operator=]]] + [Move-assign a basic_seq_packet_socket from another. [hr] - Move-assign a basic_datagram_socket from a socket of another protocol type. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]] - [Receive some data on a connected socket. ] + Move-assign a basic_seq_packet_socket from a socket of another protocol type. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]] - [Receive a datagram with the endpoint of the sender. ] + [[link boost_asio.reference.basic_seq_packet_socket.receive [*receive]]] + [Receive some data on the socket. + [hr] + Receive some data on a connected socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.release [*release]]] + [[link boost_asio.reference.basic_seq_packet_socket.release [*release]]] [Release ownership of the underlying native socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]] + [[link boost_asio.reference.basic_seq_packet_socket.remote_endpoint [*remote_endpoint]]] [Get the remote endpoint of the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.send [*send]]] - [Send some data on a connected socket. ] - ] - - [ - [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]] - [Send a datagram to the specified endpoint. ] + [[link boost_asio.reference.basic_seq_packet_socket.send [*send]]] + [Send some data on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]] + [[link boost_asio.reference.basic_seq_packet_socket.set_option [*set_option]]] [Set an option on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]] + [[link boost_asio.reference.basic_seq_packet_socket.shutdown [*shutdown]]] [Disable sends or receives on the socket. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.wait [*wait]]] + [[link boost_asio.reference.basic_seq_packet_socket.wait [*wait]]] [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] ] [ - [[link boost_asio.reference.basic_datagram_socket._basic_datagram_socket [*~basic_datagram_socket]] [destructor]] + [[link boost_asio.reference.basic_seq_packet_socket._basic_seq_packet_socket [*~basic_seq_packet_socket]] [destructor]] [Destroys the socket. ] ] @@ -129968,38 +134043,38 @@ The UNIX domain socket type. [[Name][Description]] [ - [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.max_connections [*max_connections]] [static]] [(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.max_listen_connections [*max_listen_connections]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.max_listen_connections [*max_listen_connections]] [static]] [The maximum length of the queue of pending incoming connections. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_do_not_route [*message_do_not_route]] [static]] [Specify that the data should not be subject to routing. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_end_of_record [*message_end_of_record]] [static]] [Specifies that the data marks the end of a record. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_out_of_band [*message_out_of_band]] [static]] [Process out-of-band data. ] ] [ - [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]] [static]] + [[link boost_asio.reference.basic_seq_packet_socket.message_peek [*message_peek]] [static]] [Peek at incoming data without removing it from the input queue. ] ] ] -The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. +The [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] class template provides asynchronous and blocking sequenced packet socket functionality. [heading Thread Safety] @@ -130008,12 +134083,12 @@ The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] cl ['Shared] ['objects:] Unsafe. -Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. +Synchronous `send`, `receive`, `connect`, and `shutdown` operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as `open` or `close`, are not thread safe. [heading Requirements] -['Header: ][^boost/asio/local/datagram_protocol.hpp] +['Header: ][^boost/asio/local/seq_packet_protocol.hpp] ['Convenience header: ][^boost/asio.hpp] @@ -130022,9 +134097,9 @@ Synchronous `send`, `send_to`, `receive`, `receive_from`, `connect`, and `shutdo -[section:type local::datagram_protocol::type] +[section:type local::seq_packet_protocol::type] -[indexterm2 boost_asio.indexterm.local__datagram_protocol.type..type..local::datagram_protocol] +[indexterm2 boost_asio.indexterm.local__seq_packet_protocol.type..type..local::seq_packet_protocol] Obtain an identifier for the type of the protocol. @@ -138060,7 +142135,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` ``[link boost_asio.reference.post.overload2 post]``( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); `` [''''»''' [link boost_asio.reference.post.overload2 more...]]`` template< @@ -138195,7 +142270,7 @@ Submits a completion token or function object for execution. ``[link boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]`` post( const Executor & ex, NullaryToken && token = ``[link boost_asio.reference.asynchronous_operations.default_completion_tokens ['DEFAULT]]``, - typename constraint< execution::is_executor< Executor >::value||is_executor< Executor >::value >::type = 0); + typename constraint< (execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value >::type = 0); This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. @@ -145590,6 +149665,20 @@ Typedef for the typical usage of a signal set. ] + [ + + [[link boost_asio.reference.basic_signal_set.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.basic_signal_set.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + ] [heading Member Functions] @@ -145598,7 +149687,9 @@ Typedef for the typical usage of a signal set. [ [[link boost_asio.reference.basic_signal_set.add [*add]]] - [Add a signal to a signal_set. ] + [Add a signal to a signal_set. + [hr] + Add a signal to a signal_set with the specified flags. ] ] [ @@ -145715,6 +149806,129 @@ POSIX allows signals to be blocked using functions such as `sigprocmask()` and ` [endsect] +[section:signal_set_base signal_set_base] + +[indexterm1 boost_asio.indexterm.signal_set_base..signal_set_base] + + +The [link boost_asio.reference.signal_set_base `signal_set_base`] class is used as a base for the [link boost_asio.reference.basic_signal_set `basic_signal_set`] class templates so that we have a common place to define the flags enum. + + + class signal_set_base + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.signal_set_base.flags [*flags]]] + [Enumeration representing the different types of flags that may specified when adding a signal to a set. ] + + ] + + [ + + [[link boost_asio.reference.signal_set_base.flags_t [*flags_t]]] + [Portability typedef. ] + + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.signal_set_base._signal_set_base [*~signal_set_base]] [destructor]] + [Protected destructor to prevent deletion through this type. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/signal_set_base.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:flags signal_set_base::flags] + +[indexterm2 boost_asio.indexterm.signal_set_base.flags..flags..signal_set_base] +Enumeration representing the different types of flags that may specified when adding a signal to a set. + + enum flags + +[indexterm2 boost_asio.indexterm.signal_set_base.flags.none..none..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.restart..restart..signal_set_base] +[indexterm2 boost_asio.indexterm.signal_set_base.flags.dont_care..dont_care..signal_set_base] + +[heading Values] +[variablelist + + [ + [none] + [Bitmask representing no flags. ] + ] + + [ + [restart] + [Affects the behaviour of interruptible functions such that, if the function would have failed with error::interrupted when interrupted by the specified signal, the function shall instead be restarted and not fail with error::interrupted. ] + ] + + [ + [dont_care] + [Special value to indicate that the signal registration does not care which flags are set, and so will not conflict with any prior registrations of the same signal. ] + ] + +] + + + +[endsect] + + + +[section:flags_t signal_set_base::flags_t] + +[indexterm2 boost_asio.indexterm.signal_set_base.flags_t..flags_t..signal_set_base] +Portability typedef. + + + typedef flags flags_t; + + + +[heading Requirements] + +['Header: ][^boost/asio/signal_set_base.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:_signal_set_base signal_set_base::~signal_set_base] + +[indexterm2 boost_asio.indexterm.signal_set_base._signal_set_base..~signal_set_base..signal_set_base] +Protected destructor to prevent deletion through this type. + + + ~signal_set_base(); + + + +[endsect] + + + +[endsect] + [section:socket_base socket_base] [indexterm1 boost_asio.indexterm.socket_base..socket_base] @@ -148331,7 +152545,7 @@ Following the move, the following operations only are valid for the moved-from o Implement various bug workarounds. - static const long default_workarounds = implementation_defined; + static const uint64_t default_workarounds = implementation_defined; @@ -148674,7 +152888,7 @@ The native handle type of the SSL context. Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; + static const uint64_t no_compression = implementation_defined; @@ -148688,7 +152902,7 @@ Disable compression. Compression is disabled by default. Disable SSL v2. - static const long no_sslv2 = implementation_defined; + static const uint64_t no_sslv2 = implementation_defined; @@ -148702,7 +152916,7 @@ Disable SSL v2. Disable SSL v3. - static const long no_sslv3 = implementation_defined; + static const uint64_t no_sslv3 = implementation_defined; @@ -148716,7 +152930,7 @@ Disable SSL v3. Disable TLS v1. - static const long no_tlsv1 = implementation_defined; + static const uint64_t no_tlsv1 = implementation_defined; @@ -148730,7 +152944,7 @@ Disable TLS v1. Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; + static const uint64_t no_tlsv1_1 = implementation_defined; @@ -148744,7 +152958,7 @@ Disable TLS v1.1. Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; + static const uint64_t no_tlsv1_2 = implementation_defined; @@ -148758,7 +152972,7 @@ Disable TLS v1.2. Disable TLS v1.3. - static const long no_tlsv1_3 = implementation_defined; + static const uint64_t no_tlsv1_3 = implementation_defined; @@ -148811,7 +153025,7 @@ Following the move, the following operations only are valid for the moved-from o Bitmask type for SSL options. - typedef long options; + typedef uint64_t options; @@ -149479,7 +153693,7 @@ Calls `SSL_CTX_set_verify`. Always create a new key when using tmp\_dh parameters. - static const long single_dh_use = implementation_defined; + static const uint64_t single_dh_use = implementation_defined; @@ -150651,7 +154865,7 @@ The [link boost_asio.reference.ssl__context_base `ssl::context_base`] class is u Implement various bug workarounds. - static const long default_workarounds = implementation_defined; + static const uint64_t default_workarounds = implementation_defined; @@ -150859,7 +155073,7 @@ Different methods supported by a context. Disable compression. Compression is disabled by default. - static const long no_compression = implementation_defined; + static const uint64_t no_compression = implementation_defined; @@ -150873,7 +155087,7 @@ Disable compression. Compression is disabled by default. Disable SSL v2. - static const long no_sslv2 = implementation_defined; + static const uint64_t no_sslv2 = implementation_defined; @@ -150887,7 +155101,7 @@ Disable SSL v2. Disable SSL v3. - static const long no_sslv3 = implementation_defined; + static const uint64_t no_sslv3 = implementation_defined; @@ -150901,7 +155115,7 @@ Disable SSL v3. Disable TLS v1. - static const long no_tlsv1 = implementation_defined; + static const uint64_t no_tlsv1 = implementation_defined; @@ -150915,7 +155129,7 @@ Disable TLS v1. Disable TLS v1.1. - static const long no_tlsv1_1 = implementation_defined; + static const uint64_t no_tlsv1_1 = implementation_defined; @@ -150929,7 +155143,7 @@ Disable TLS v1.1. Disable TLS v1.2. - static const long no_tlsv1_2 = implementation_defined; + static const uint64_t no_tlsv1_2 = implementation_defined; @@ -150943,7 +155157,7 @@ Disable TLS v1.2. Disable TLS v1.3. - static const long no_tlsv1_3 = implementation_defined; + static const uint64_t no_tlsv1_3 = implementation_defined; @@ -150957,7 +155171,7 @@ Disable TLS v1.3. Bitmask type for SSL options. - typedef long options; + typedef uint64_t options; @@ -151009,7 +155223,7 @@ Purpose of PEM password. Always create a new key when using tmp\_dh parameters. - static const long single_dh_use = implementation_defined; + static const uint64_t single_dh_use = implementation_defined; From 23e77303793ac1cf92645809c78c8bbb1375392d Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 7 Mar 2023 08:16:45 +1100 Subject: [PATCH 13/22] Fix doc generation for literal operators. --- doc/reference.qbk | 16 ++++++++-------- doc/reference.xsl | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/reference.qbk b/doc/reference.qbk index 16aff5458a..4df969e3e9 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -74248,23 +74248,23 @@ This function is implemented in terms of `memcpy`, and consequently it cannot be [endsect] -[section:buffer_literals__operator""_buf buffer_literals::operator""_buf] +[section:buffer_literals__operator_quot__quot__buf buffer_literals::operator""_buf] -[indexterm1 boost_asio.indexterm.buffer_literals__operator""_buf..buffer_literals::operator""_buf] +[indexterm1 boost_asio.indexterm.buffer_literals__operator_quot__quot__buf..buffer_literals::operator""_buf] Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from string literals. - const_buffer ``[link boost_asio.reference.buffer_literals__operator""_buf.overload1 operator""_buf]``( + const_buffer ``[link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload1 operator""_buf]``( const char * data, std::size_t n); - `` [''''»''' [link boost_asio.reference.buffer_literals__operator""_buf.overload1 more...]]`` + `` [''''»''' [link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload1 more...]]`` Literal operator for creating [link boost_asio.reference.const_buffer `const_buffer`] objects from unbounded binary or hexadecimal integer literals. template< - char... ``[link boost_asio.reference.Chars Chars]``> - const_buffer ``[link boost_asio.reference.buffer_literals__operator""_buf.overload2 operator""_buf]``(); - `` [''''»''' [link boost_asio.reference.buffer_literals__operator""_buf.overload2 more...]]`` + char... Chars> + const_buffer ``[link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload2 operator""_buf]``(); + `` [''''»''' [link boost_asio.reference.buffer_literals__operator_quot__quot__buf.overload2 more...]]`` [heading Requirements] @@ -74296,7 +74296,7 @@ Literal operator for creating [link boost_asio.reference.const_buffer `const_buf template< - char... ``[link boost_asio.reference.Chars Chars]``> + char... Chars> const_buffer operator""_buf(); diff --git a/doc/reference.xsl b/doc/reference.xsl index 68128813f7..0cf65dcfd1 100644 --- a/doc/reference.xsl +++ b/doc/reference.xsl @@ -367,6 +367,12 @@ select="concat(substring-before($name, ','), '_comma_', substring-after($name, ','))"/> + + + + + + + + From 076089ec7735246ed0ac1a8bea1ec0313de7fb48 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Wed, 8 Mar 2023 21:04:56 +1100 Subject: [PATCH 14/22] Fix deferred interoperability with multiple completion signatures. --- include/boost/asio/async_result.hpp | 40 ++++- include/boost/asio/deferred.hpp | 239 ++++++++++++++++++++------- include/boost/asio/impl/deferred.hpp | 63 ++++++- 3 files changed, 279 insertions(+), 63 deletions(-) diff --git a/include/boost/asio/async_result.hpp b/include/boost/asio/async_result.hpp index 53143d15fd..b23bf4a77a 100644 --- a/include/boost/asio/async_result.hpp +++ b/include/boost/asio/async_result.hpp @@ -1399,6 +1399,42 @@ namespace detail { struct completion_signature_probe {}; +#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) + +template +struct completion_signature_probe_result +{ + template