diff options
Diffstat (limited to 'boost/beast/core/basic_stream.hpp')
-rw-r--r-- | boost/beast/core/basic_stream.hpp | 100 |
1 files changed, 96 insertions, 4 deletions
diff --git a/boost/beast/core/basic_stream.hpp b/boost/beast/core/basic_stream.hpp index 7364f5a887..19e9597464 100644 --- a/boost/beast/core/basic_stream.hpp +++ b/boost/beast/core/basic_stream.hpp @@ -233,6 +233,7 @@ public: using endpoint_type = typename Protocol::endpoint; private: + using op_state = basic_op_state<Executor>; static_assert( net::is_executor<Executor>::value || net::execution::is_executor<Executor>::value, "Executor type requirements not met"); @@ -247,15 +248,12 @@ private: op_state read; op_state write; -#if 0 net::basic_waitable_timer< std::chrono::steady_clock, net::wait_traits< std::chrono::steady_clock>, Executor> timer; // rate timer; -#else - net::steady_timer timer; -#endif + int waiting = 0; impl_type(impl_type&&) = default; @@ -356,6 +354,22 @@ public: ! std::is_constructible<RatePolicy, Arg0>::value>::type> explicit basic_stream(Arg0&& argo, Args&&... args); + + + /** Constructor + * + * A constructor that rebinds the executor. + * + * @tparam Executor_ The new executor + * @param other The original socket to be rebound. + */ + template<class Executor_> + explicit + basic_stream(basic_stream<Protocol, Executor_, RatePolicy> && other); + + + template<typename, typename, typename> + friend class basic_stream; #endif /** Constructor @@ -919,6 +933,17 @@ public: this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_connect operation. + @see async_connect */ template< @@ -972,6 +997,18 @@ public: immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_connect operation. + */ template< class EndpointSequence, @@ -1064,6 +1101,17 @@ public: } }; @endcode + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_connect operation. */ template< class EndpointSequence, @@ -1129,6 +1177,17 @@ public: immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_connect operation. */ template< class Iterator, @@ -1189,6 +1248,17 @@ public: immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `net::post`. + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_connect operation. */ template< class Iterator, @@ -1316,6 +1386,17 @@ public: number of bytes. Consider using the function `net::async_read` if you need to ensure that the requested amount of data is read before the asynchronous operation completes. + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_read_some operation. */ template< class MutableBufferSequence, @@ -1439,6 +1520,17 @@ public: number of bytes. Consider using the function `net::async_write` if you need to ensure that the requested amount of data is sent before the asynchronous operation completes. + + @par Per-Operation Cancellation + + This asynchronous operation supports cancellation for the following + net::cancellation_type values: + + @li @c net::cancellation_type::terminal + @li @c net::cancellation_type::partial + @li @c net::cancellation_type::total + + if they are also supported by the socket's @c async_write_some operation. */ template< class ConstBufferSequence, |