Regenerate documentation.
diff --git a/asio/src/doc/reference.qbk b/asio/src/doc/reference.qbk index 857781f..7a9e7e7 100644 --- a/asio/src/doc/reference.qbk +++ b/asio/src/doc/reference.qbk
@@ -25,6 +25,7 @@ [include requirements/DatagramSocketService.qbk] [include requirements/DescriptorService.qbk] [include requirements/Endpoint.qbk] +[include requirements/Executor.qbk] [include requirements/GettableSerialPortOption.qbk] [include requirements/GettableSocketOption.qbk] [include requirements/Handler.qbk] @@ -74,11 +75,11 @@ template< typename ``[link asio.reference.Service Service]``> void add_service( - io_service & ios, + execution_context & e, Service * svc); -This function is used to add a service to the [link asio.reference.io_service `io_service`]. +This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. [heading Parameters] @@ -86,11 +87,11 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.io_service `io_service`]. When the [link asio.reference.io_service `io_service`] object is destroyed, it will destroy the service object by performing: +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: `` - delete static_cast<io_service::service*>(svc) + delete static_cast<execution_context::service*>(svc) `` ]] @@ -102,9 +103,9 @@ [variablelist -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.io_service `io_service`].]] +[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] -[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.io_service `io_service`] is not the [link asio.reference.io_service `io_service`] object specified by the ios parameter. ]] +[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] ] @@ -112,7 +113,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/impl/execution_context.hpp] ['Convenience header: ][^asio.hpp] @@ -345,6 +346,344 @@ [endsect] +[section:associated_allocator associated_allocator] + + +Traits type used to obtain the allocator associated with an object. + + + template< + typename T, + typename Allocator = std::allocator<void>> + struct associated_allocator + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.associated_allocator.type [*type]]] + [If T has a nested type allocator_type, T::allocator_type. Otherwise Allocator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_allocator.get [*get]]] + [If T has a nested type allocator_type, returns t.get_allocator(). Otherwise returns a. ] + ] + +] + +A program may specialise this traits type if the `T` template parameter in the specialisation is a user-defined type. The template parameter `Allocator` shall be a type meeting the Allocator requirements. + +Specialisations shall meet the following requirements, where `t` is a const reference to an object of type `T`, and `a` is an object of type `Allocator`. + + +* Provide a nested typedef `type` that identifies a type meeting the Allocator requirements. + + +* Provide a noexcept static member function named `get`, callable as `get(t)` and with return type `type`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,a)` and with return type `type`. + + + +[heading Requirements] + +['Header: ][^asio/associated_allocator.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:get associated_allocator::get] + +[indexterm2 get..associated_allocator] +If `T` has a nested type `allocator_type`, returns `t.get_allocator()`. Otherwise returns `a`. + + + static type get( + const T & t, + const Allocator & a = Allocator()); + + + +[endsect] + + + +[section:type associated_allocator::type] + +[indexterm2 type..associated_allocator] +If `T` has a nested type `allocator_type`, `T::allocator_type`. Otherwise `Allocator`. + + + typedef see_below type; + + + +[heading Requirements] + +['Header: ][^asio/associated_allocator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + +[section:associated_executor associated_executor] + + +Traits type used to obtain the executor associated with an object. + + + template< + typename T, + typename ``[link asio.reference.Executor Executor]`` = system_executor> + struct associated_executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.associated_executor.type [*type]]] + [If T has a nested type executor_type, T::executor_type. Otherwise Executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.associated_executor.get [*get]]] + [If T has a nested type executor_type, returns t.get_executor(). Otherwise returns ex. ] + ] + +] + +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`. + + +* Provide a noexcept static member function named `get`, callable as `get(t,e)` and with return type `type`. + + + +[heading Requirements] + +['Header: ][^asio/associated_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:get associated_executor::get] + +[indexterm2 get..associated_executor] +If `T` has a nested type `executor_type`, returns `t.get_executor()`. Otherwise returns `ex`. + + + static type get( + const T & t, + const Executor & ex = Executor()); + + + +[endsect] + + + +[section:type associated_executor::type] + +[indexterm2 type..associated_executor] +If `T` has a nested type `executor_type`, `T::executor_type`. Otherwise `Executor`. + + + typedef see_below type; + + + +[heading Requirements] + +['Header: ][^asio/associated_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + +[section:async_completion async_completion] + + +Helper template to deduce the real type of a handler, capture a local copy of the handler, and then create an [link asio.reference.async_result `async_result`] for the handler. + + + template< + typename ``[link asio.reference.Handler Handler]``, + typename Signature> + struct async_completion + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.async_completion.handler_type [*handler_type]]] + [The real handler type to be used for the asynchronous operation. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.async_completion.async_completion [*async_completion]]] + [Constructor. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.async_completion.handler [*handler]]] + [A copy of, or reference to, a real handler object. ] + ] + + [ + [[link asio.reference.async_completion.result [*result]]] + [The result of the asynchronous operation's initiating function. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/async_result.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:async_completion async_completion::async_completion] + +[indexterm2 async_completion..async_completion] +Constructor. + + + async_completion( + typename remove_reference< Handler >::type & orig_handler); + + +The constructor creates the concrete handler and makes the link between the handler and the asynchronous result. + + +[endsect] + + + +[section:handler async_completion::handler] + +[indexterm2 handler..async_completion] +A copy of, or reference to, a real handler object. + + + conditional< is_same< Handler, handler_type >::value, handler_type &, handler_type >::type handler; + + + +[endsect] + + + +[section:handler_type async_completion::handler_type] + +[indexterm2 handler_type..async_completion] +The real handler type to be used for the asynchronous operation. + + + typedef asio::handler_type< Handler, Signature >::type handler_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.handler_type.type [*type]]] + [The handler type for the specific signature. ] + + ] + +] + +The [link asio.reference.handler_type `handler_type`] traits class is used for determining the concrete handler type to be used for an asynchronous operation. It allows the handler type to be determined at the point where the specific completion handler signature is known. + +This template may be specialised for user-defined completion token types. + + +[heading Requirements] + +['Header: ][^asio/async_result.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:result async_completion::result] + +[indexterm2 result..async_completion] +The result of the asynchronous operation's initiating function. + + + async_result< typename asio::handler_type< Handler, Signature >::type > result; + + + +[endsect] + + + +[endsect] + [section:async_connect async_connect] [indexterm1 async_connect] @@ -2920,6 +3259,69 @@ [endsect] +[section:bad_executor bad_executor] + + +Exception thrown when trying to access an empty polymorphic executor. + + + class bad_executor : + public std::exception + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.bad_executor.bad_executor [*bad_executor]]] + [Constructor. ] + ] + + [ + [[link asio.reference.bad_executor.what [*what]]] + [Obtain message associated with exception. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:bad_executor bad_executor::bad_executor] + +[indexterm2 bad_executor..bad_executor] +Constructor. + + + bad_executor(); + + + +[endsect] + + + +[section:what bad_executor::what] + +[indexterm2 what..bad_executor] +Obtain message associated with exception. + + + virtual const char * what() const; + + + +[endsect] + + + +[endsect] + [section:basic_datagram_socket basic_datagram_socket] @@ -2981,6 +3383,13 @@ [ + [[link asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -3023,20 +3432,6 @@ [ - [[link asio.reference.basic_datagram_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -3091,6 +3486,13 @@ ] + [ + + [[link asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -3128,6 +3530,11 @@ ] [ + [[link 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 asio.reference.basic_datagram_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -3173,8 +3580,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -3205,11 +3617,6 @@ ] [ - [[link asio.reference.basic_datagram_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_datagram_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -3275,6 +3682,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -3324,22 +3736,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_datagram_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_datagram_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. @@ -4011,6 +4407,71 @@ [endsect] + +[section:async_wait basic_datagram_socket::async_wait] + + +['Inherited from basic_socket.] + +[indexterm2 async_wait..basic_datagram_socket] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + [section:at_mark basic_datagram_socket::at_mark] [indexterm2 at_mark..basic_datagram_socket] @@ -5232,6 +5693,104 @@ [endsect] + +[section:executor_type basic_datagram_socket::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_datagram_socket] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_datagram_socket.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_datagram_socket::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_datagram_socket] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_datagram_socket::get_implementation] [indexterm2 get_implementation..basic_datagram_socket] @@ -5287,7 +5846,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_datagram_socket] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -5488,23 +6047,6 @@ [endsect] -[section:implementation basic_datagram_socket::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_datagram_socket] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_datagram_socket::implementation_type] @@ -6035,6 +6577,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -6077,20 +6626,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -6145,6 +6680,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -6162,6 +6704,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -6207,8 +6754,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -6239,11 +6791,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -6289,6 +6836,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -6343,22 +6895,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -6491,25 +7027,6 @@ -[section:native basic_datagram_socket::native] - - -['Inherited from basic_socket.] - -[indexterm2 native..basic_datagram_socket] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_datagram_socket::native_handle] @@ -6639,7 +7156,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -6663,7 +7180,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -6754,7 +7271,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -6778,7 +7295,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -6862,7 +7379,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -6886,7 +7403,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -6900,27 +7417,6 @@ [endsect] - -[section:native_type basic_datagram_socket::native_type] - -[indexterm2 native_type..basic_datagram_socket] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef DatagramSocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_datagram_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_datagram_socket::non_blocking] [indexterm2 non_blocking..basic_datagram_socket] @@ -7057,48 +7553,6 @@ [endsect] - -[section:non_blocking_io basic_datagram_socket::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_datagram_socket] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_datagram_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_datagram_socket::open] [indexterm2 open..basic_datagram_socket] @@ -8485,30 +8939,6 @@ [endsect] -[section:service basic_datagram_socket::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_datagram_socket] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_datagram_socket::service_type] @@ -8827,6 +9257,158 @@ [endsect] +[section:wait basic_datagram_socket::wait] + +[indexterm2 wait..basic_datagram_socket] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_datagram_socket.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_datagram_socket.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_datagram_socket.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_datagram_socket.wait.overload2 more...]]`` + + +[section:overload1 basic_datagram_socket::wait (1 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_datagram_socket::wait (2 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_datagram_socket::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_datagram_socket] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_datagram_socket] +[indexterm2 wait_write..basic_datagram_socket] +[indexterm2 wait_error..basic_datagram_socket] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [endsect] @@ -8857,6 +9439,13 @@ [ + [[link asio.reference.basic_deadline_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -8928,8 +9517,13 @@ ] [ + [[link asio.reference.basic_deadline_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -8955,22 +9549,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_deadline_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_deadline_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_deadline_timer `basic_deadline_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A deadline timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -9476,6 +10054,87 @@ [endsect] + +[section:executor_type basic_deadline_timer::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_deadline_timer] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_deadline_timer.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:expires_at basic_deadline_timer::expires_at] [indexterm2 expires_at..basic_deadline_timer] @@ -9762,6 +10421,23 @@ [endsect] + +[section:get_executor basic_deadline_timer::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_deadline_timer] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_deadline_timer::get_implementation] [indexterm2 get_implementation..basic_deadline_timer] @@ -9817,7 +10493,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_deadline_timer] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -9885,23 +10561,6 @@ [endsect] -[section:implementation basic_deadline_timer::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_deadline_timer] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_deadline_timer::implementation_type] @@ -9926,30 +10585,6 @@ -[section:service basic_deadline_timer::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_deadline_timer] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_deadline_timer::service_type] @@ -10107,6 +10742,13 @@ [ + [[link asio.reference.basic_io_object.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_io_object.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -10126,8 +10768,13 @@ [[Name][Description]] [ + [[link asio.reference.basic_io_object.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_io_object.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] ] @@ -10165,22 +10812,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_io_object.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_io_object.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - [heading Remarks] @@ -10266,6 +10897,98 @@ [endsect] + +[section:executor_type basic_io_object::executor_type] + +[indexterm2 executor_type..basic_io_object] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_io_object.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_io_object::get_executor] + +[indexterm2 get_executor..basic_io_object] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_io_object::get_implementation] [indexterm2 get_implementation..basic_io_object] @@ -10312,7 +11035,7 @@ [section:get_io_service basic_io_object::get_io_service] [indexterm2 get_io_service..basic_io_object] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -10374,20 +11097,6 @@ [endsect] -[section:implementation basic_io_object::implementation] - -[indexterm2 implementation..basic_io_object] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_io_object::implementation_type] [indexterm2 implementation_type..basic_io_object] @@ -10439,27 +11148,6 @@ -[section:service basic_io_object::service] - -[indexterm2 service..basic_io_object] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_io_object::service_type] [indexterm2 service_type..basic_io_object] @@ -10565,6 +11253,13 @@ [ + [[link asio.reference.basic_raw_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_raw_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -10607,20 +11302,6 @@ [ - [[link asio.reference.basic_raw_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_raw_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -10675,6 +11356,13 @@ ] + [ + + [[link asio.reference.basic_raw_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -10712,6 +11400,11 @@ ] [ + [[link asio.reference.basic_raw_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 asio.reference.basic_raw_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -10757,8 +11450,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -10789,11 +11487,6 @@ ] [ - [[link asio.reference.basic_raw_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_raw_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -10859,6 +11552,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_raw_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -10908,22 +11606,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_raw_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_raw_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_raw_socket `basic_raw_socket`] class template provides asynchronous and blocking raw-oriented socket functionality. @@ -11595,6 +12277,71 @@ [endsect] + +[section:async_wait basic_raw_socket::async_wait] + + +['Inherited from basic_socket.] + +[indexterm2 async_wait..basic_raw_socket] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + [section:at_mark basic_raw_socket::at_mark] [indexterm2 at_mark..basic_raw_socket] @@ -12816,6 +13563,104 @@ [endsect] + +[section:executor_type basic_raw_socket::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_raw_socket] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_raw_socket.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_raw_socket::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_raw_socket] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_raw_socket::get_implementation] [indexterm2 get_implementation..basic_raw_socket] @@ -12871,7 +13716,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_raw_socket] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -13072,23 +13917,6 @@ [endsect] -[section:implementation basic_raw_socket::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_raw_socket] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_raw_socket::implementation_type] @@ -13619,6 +14447,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -13661,20 +14496,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -13729,6 +14550,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -13746,6 +14574,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -13791,8 +14624,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -13823,11 +14661,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -13873,6 +14706,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -13927,22 +14765,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -14075,25 +14897,6 @@ -[section:native basic_raw_socket::native] - - -['Inherited from basic_socket.] - -[indexterm2 native..basic_raw_socket] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_raw_socket::native_handle] @@ -14223,7 +15026,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -14247,7 +15050,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -14338,7 +15141,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -14362,7 +15165,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -14446,7 +15249,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -14470,7 +15273,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -14484,27 +15287,6 @@ [endsect] - -[section:native_type basic_raw_socket::native_type] - -[indexterm2 native_type..basic_raw_socket] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef RawSocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_raw_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_raw_socket::non_blocking] [indexterm2 non_blocking..basic_raw_socket] @@ -14641,48 +15423,6 @@ [endsect] - -[section:non_blocking_io basic_raw_socket::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_raw_socket] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_raw_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_raw_socket::open] [indexterm2 open..basic_raw_socket] @@ -16069,30 +16809,6 @@ [endsect] -[section:service basic_raw_socket::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_raw_socket] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_raw_socket::service_type] @@ -16411,6 +17127,158 @@ [endsect] +[section:wait basic_raw_socket::wait] + +[indexterm2 wait..basic_raw_socket] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_raw_socket.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_raw_socket.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_raw_socket.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_raw_socket.wait.overload2 more...]]`` + + +[section:overload1 basic_raw_socket::wait (1 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_raw_socket::wait (2 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_raw_socket::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_raw_socket] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_raw_socket] +[indexterm2 wait_write..basic_raw_socket] +[indexterm2 wait_error..basic_raw_socket] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [endsect] @@ -16475,6 +17343,13 @@ [ + [[link asio.reference.basic_seq_packet_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_seq_packet_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -16517,20 +17392,6 @@ [ - [[link asio.reference.basic_seq_packet_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_seq_packet_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_seq_packet_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -16585,6 +17446,13 @@ ] + [ + + [[link asio.reference.basic_seq_packet_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -16612,6 +17480,11 @@ ] [ + [[link 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 asio.reference.basic_seq_packet_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -16657,8 +17530,13 @@ ] [ + [[link asio.reference.basic_seq_packet_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_seq_packet_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -16689,11 +17567,6 @@ ] [ - [[link asio.reference.basic_seq_packet_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_seq_packet_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -16751,6 +17624,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -16800,22 +17678,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_seq_packet_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_seq_packet_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] class template provides asynchronous and blocking sequenced packet socket functionality. @@ -17156,6 +18018,71 @@ [endsect] + +[section:async_wait basic_seq_packet_socket::async_wait] + + +['Inherited from basic_socket.] + +[indexterm2 async_wait..basic_seq_packet_socket] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + [section:at_mark basic_seq_packet_socket::at_mark] [indexterm2 at_mark..basic_seq_packet_socket] @@ -18377,6 +19304,104 @@ [endsect] + +[section:executor_type basic_seq_packet_socket::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_seq_packet_socket] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_seq_packet_socket.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_seq_packet_socket::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_seq_packet_socket] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_seq_packet_socket::get_implementation] [indexterm2 get_implementation..basic_seq_packet_socket] @@ -18432,7 +19457,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_seq_packet_socket] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -18633,23 +19658,6 @@ [endsect] -[section:implementation basic_seq_packet_socket::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_seq_packet_socket] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_seq_packet_socket::implementation_type] @@ -19180,6 +20188,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -19222,20 +20237,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -19290,6 +20291,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -19307,6 +20315,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -19352,8 +20365,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -19384,11 +20402,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -19434,6 +20447,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -19488,22 +20506,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -19636,25 +20638,6 @@ -[section:native basic_seq_packet_socket::native] - - -['Inherited from basic_socket.] - -[indexterm2 native..basic_seq_packet_socket] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_seq_packet_socket::native_handle] @@ -19784,7 +20767,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -19808,7 +20791,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -19899,7 +20882,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -19923,7 +20906,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -20007,7 +20990,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -20031,7 +21014,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -20045,27 +21028,6 @@ [endsect] - -[section:native_type basic_seq_packet_socket::native_type] - -[indexterm2 native_type..basic_seq_packet_socket] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef SeqPacketSocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_seq_packet_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_seq_packet_socket::non_blocking] [indexterm2 non_blocking..basic_seq_packet_socket] @@ -20202,48 +21164,6 @@ [endsect] - -[section:non_blocking_io basic_seq_packet_socket::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_seq_packet_socket] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_seq_packet_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_seq_packet_socket::open] [indexterm2 open..basic_seq_packet_socket] @@ -21209,30 +22129,6 @@ -[section:service basic_seq_packet_socket::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_seq_packet_socket] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_seq_packet_socket::service_type] @@ -21551,6 +22447,158 @@ [endsect] +[section:wait basic_seq_packet_socket::wait] + +[indexterm2 wait..basic_seq_packet_socket] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_seq_packet_socket.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_seq_packet_socket.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_seq_packet_socket.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_seq_packet_socket.wait.overload2 more...]]`` + + +[section:overload1 basic_seq_packet_socket::wait (1 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_seq_packet_socket::wait (2 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_seq_packet_socket::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_seq_packet_socket] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_seq_packet_socket] +[indexterm2 wait_write..basic_seq_packet_socket] +[indexterm2 wait_error..basic_seq_packet_socket] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [endsect] @@ -21573,6 +22621,13 @@ [ + [[link asio.reference.basic_serial_port.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_serial_port.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -21594,13 +22649,6 @@ [ - [[link asio.reference.basic_serial_port.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a serial port. ] - - ] - - [ - [[link asio.reference.basic_serial_port.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -21649,8 +22697,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -21671,11 +22724,6 @@ ] [ - [[link asio.reference.basic_serial_port.native [*native]]] - [(Deprecated: Use native_handle().) Get the native serial port representation. ] - ] - - [ [[link asio.reference.basic_serial_port.native_handle [*native_handle]]] [Get the native serial port representation. ] ] @@ -21728,22 +22776,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_serial_port.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_serial_port.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports. @@ -22279,6 +23311,104 @@ [endsect] + +[section:executor_type basic_serial_port::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_serial_port] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_serial_port.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_serial_port::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_serial_port] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_serial_port::get_implementation] [indexterm2 get_implementation..basic_serial_port] @@ -22334,7 +23464,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_serial_port] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -22500,23 +23630,6 @@ [endsect] -[section:implementation basic_serial_port::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_serial_port] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_serial_port::implementation_type] @@ -22634,6 +23747,13 @@ [ + [[link asio.reference.basic_serial_port.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_serial_port.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -22655,13 +23775,6 @@ [ - [[link asio.reference.basic_serial_port.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a serial port. ] - - ] - - [ - [[link asio.reference.basic_serial_port.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -22710,8 +23823,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -22732,11 +23850,6 @@ ] [ - [[link asio.reference.basic_serial_port.native [*native]]] - [(Deprecated: Use native_handle().) Get the native serial port representation. ] - ] - - [ [[link asio.reference.basic_serial_port.native_handle [*native_handle]]] [Get the native serial port representation. ] ] @@ -22789,22 +23902,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_serial_port.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_serial_port.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports. @@ -22828,22 +23925,6 @@ -[section:native basic_serial_port::native] - -[indexterm2 native..basic_serial_port] -(Deprecated: Use `native_handle()`.) Get the native serial port representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the serial port. This is intended to allow access to native serial port functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_serial_port::native_handle] [indexterm2 native_handle..basic_serial_port] @@ -22880,27 +23961,6 @@ [endsect] - -[section:native_type basic_serial_port::native_type] - -[indexterm2 native_type..basic_serial_port] -(Deprecated: Use native\_handle\_type.) The native representation of a serial port. - - - typedef SerialPortService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_serial_port.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_serial_port::open] [indexterm2 open..basic_serial_port] @@ -23222,30 +24282,6 @@ [endsect] -[section:service basic_serial_port::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_serial_port] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_serial_port::service_type] @@ -23514,6 +24550,13 @@ [ + [[link asio.reference.basic_signal_set.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_signal_set.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -23564,8 +24607,13 @@ ] [ + [[link asio.reference.basic_signal_set.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_signal_set.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -23591,22 +24639,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_signal_set.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_signal_set.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_signal_set `basic_signal_set`] class template provides the ability to perform an asynchronous wait for one or more signals to occur. Most applications will use the [link asio.reference.signal_set `signal_set`] typedef. @@ -24201,6 +25233,104 @@ [endsect] + +[section:executor_type basic_signal_set::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_signal_set] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_signal_set.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_signal_set::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_signal_set] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_signal_set::get_implementation] [indexterm2 get_implementation..basic_signal_set] @@ -24256,7 +25386,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_signal_set] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -24324,23 +25454,6 @@ [endsect] -[section:implementation basic_signal_set::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_signal_set] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_signal_set::implementation_type] @@ -24463,30 +25576,6 @@ [endsect] -[section:service basic_signal_set::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_signal_set] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_signal_set::service_type] @@ -24575,6 +25664,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -24617,20 +25713,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -24685,6 +25767,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -24702,6 +25791,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -24747,8 +25841,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -24779,11 +25878,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -24829,6 +25923,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -24883,22 +25982,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -25033,6 +26116,68 @@ [endsect] + +[section:async_wait basic_socket::async_wait] + +[indexterm2 async_wait..basic_socket] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + [section:at_mark basic_socket::at_mark] [indexterm2 at_mark..basic_socket] @@ -26218,6 +27363,104 @@ [endsect] + +[section:executor_type basic_socket::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_socket] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_socket.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_socket::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_socket] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_socket::get_implementation] [indexterm2 get_implementation..basic_socket] @@ -26273,7 +27516,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -26472,23 +27715,6 @@ [endsect] -[section:implementation basic_socket::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_socket] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_socket::implementation_type] @@ -26999,6 +28225,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -27041,20 +28274,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -27109,6 +28328,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -27126,6 +28352,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -27171,8 +28402,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -27203,11 +28439,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -27253,6 +28484,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -27307,22 +28543,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -27455,22 +28675,6 @@ -[section:native basic_socket::native] - -[indexterm2 native..basic_socket] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_socket::native_handle] [indexterm2 native_handle..basic_socket] @@ -27594,7 +28798,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -27618,7 +28822,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -27706,7 +28910,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -27730,7 +28934,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -27811,7 +29015,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -27835,7 +29039,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -27849,27 +29053,6 @@ [endsect] - -[section:native_type basic_socket::native_type] - -[indexterm2 native_type..basic_socket] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef SocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_socket::non_blocking] [indexterm2 non_blocking..basic_socket] @@ -27997,48 +29180,6 @@ [endsect] - -[section:non_blocking_io basic_socket::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_socket] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_socket::open] [indexterm2 open..basic_socket] @@ -28651,30 +29792,6 @@ -[section:service basic_socket::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_socket] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_socket::service_type] @@ -28985,6 +30102,152 @@ [endsect] +[section:wait basic_socket::wait] + +[indexterm2 wait..basic_socket] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_socket.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_socket.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_socket.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket.wait.overload2 more...]]`` + + +[section:overload1 basic_socket::wait (1 of 2 overloads)] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_socket::wait (2 of 2 overloads)] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_socket::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_socket] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_socket] +[indexterm2 wait_write..basic_socket] +[indexterm2 wait_error..basic_socket] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [section:_basic_socket basic_socket::~basic_socket] @@ -29064,6 +30327,13 @@ [ + [[link asio.reference.basic_socket_acceptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -29099,20 +30369,6 @@ [ - [[link asio.reference.basic_socket_acceptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ] - - ] - - [ - - [[link asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]] [The protocol type. ] @@ -29167,6 +30423,13 @@ ] + [ + + [[link asio.reference.basic_socket_acceptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -29221,8 +30484,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -29251,11 +30519,6 @@ ] [ - [[link asio.reference.basic_socket_acceptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native acceptor representation. ] - ] - - [ [[link asio.reference.basic_socket_acceptor.native_handle [*native_handle]]] [Get the native acceptor representation. ] ] @@ -29340,22 +30603,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket_acceptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket_acceptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections. @@ -30718,6 +31965,104 @@ [endsect] + +[section:executor_type basic_socket_acceptor::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_socket_acceptor] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_socket_acceptor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_socket_acceptor::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_socket_acceptor] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_socket_acceptor::get_implementation] [indexterm2 get_implementation..basic_socket_acceptor] @@ -30773,7 +32118,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket_acceptor] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -30972,23 +32317,6 @@ [endsect] -[section:implementation basic_socket_acceptor::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_socket_acceptor] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_socket_acceptor::implementation_type] @@ -31590,22 +32918,6 @@ -[section:native basic_socket_acceptor::native] - -[indexterm2 native..basic_socket_acceptor] -(Deprecated: Use `native_handle()`.) Get the native acceptor representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_socket_acceptor::native_handle] [indexterm2 native_handle..basic_socket_acceptor] @@ -31765,27 +33077,6 @@ [endsect] - -[section:native_type basic_socket_acceptor::native_type] - -[indexterm2 native_type..basic_socket_acceptor] -(Deprecated: Use native\_handle\_type.) The native representation of an acceptor. - - - typedef SocketAcceptorService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_socket_acceptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_socket_acceptor::non_blocking] [indexterm2 non_blocking..basic_socket_acceptor] @@ -31913,48 +33204,6 @@ [endsect] - -[section:non_blocking_io basic_socket_acceptor::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_socket_acceptor] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_socket_acceptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_socket_acceptor::open] [indexterm2 open..basic_socket_acceptor] @@ -32456,30 +33705,6 @@ -[section:service basic_socket_acceptor::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_socket_acceptor] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_socket_acceptor::service_type] @@ -32674,6 +33899,49 @@ +[section:wait_type basic_socket_acceptor::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_socket_acceptor] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_socket_acceptor] +[indexterm2 wait_write..basic_socket_acceptor] +[indexterm2 wait_error..basic_socket_acceptor] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + + [endsect] [section:basic_socket_iostream basic_socket_iostream] @@ -32697,13 +33965,20 @@ [ - [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [[link asio.reference.basic_socket_iostream.duration [*duration]]] [The duration type. ] ] [ + [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [(Deprecated: Use duration.) The duration type. ] + + ] + + [ + [[link asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]] [The endpoint type. ] @@ -32711,11 +33986,18 @@ [ - [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [[link asio.reference.basic_socket_iostream.time_point [*time_point]]] [The time type. ] ] + [ + + [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [(Deprecated: Use time_point.) The time type. ] + + ] + ] [heading Member Functions] @@ -32745,17 +34027,27 @@ ] [ + [[link asio.reference.basic_socket_iostream.expires_after [*expires_after]]] + [Set the stream's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_socket_iostream.expires_at [*expires_at]]] - [Get the stream's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the stream's expiry time as an absolute time. Set the stream's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the stream's expiry time relative to now. - Set the stream's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the stream's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_socket_iostream.expiry [*expiry]]] + [Get the stream's expiry time as an absolute time. ] ] [ @@ -32871,10 +34163,31 @@ +[section:duration basic_socket_iostream::duration] + +[indexterm2 duration..basic_socket_iostream] +The duration type. + + + typedef TimeTraits::duration duration; + + + +[heading Requirements] + +['Header: ][^asio/basic_socket_iostream.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:duration_type basic_socket_iostream::duration_type] [indexterm2 duration_type..basic_socket_iostream] -The duration type. +(Deprecated: Use duration.) The duration type. typedef TimeTraits::duration_type duration_type; @@ -32947,13 +34260,42 @@ [endsect] + +[section:expires_after basic_socket_iostream::expires_after] + +[indexterm2 expires_after..basic_socket_iostream] +Set the stream's expiry time relative to now. + + + void expires_after( + const duration & expiry_time); + + +This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. + + +[heading Parameters] + + +[variablelist + +[[expiry_time][The expiry time to be used for the timer. ]] + +] + + + + +[endsect] + + [section:expires_at basic_socket_iostream::expires_at] [indexterm2 expires_at..basic_socket_iostream] -Get the stream's expiry time as an absolute time. +(Deprecated: Use `expiry()`.) Get the stream's expiry time as an absolute time. - time_type ``[link asio.reference.basic_socket_iostream.expires_at.overload1 expires_at]``() const; + time_point ``[link asio.reference.basic_socket_iostream.expires_at.overload1 expires_at]``() const; `` [''''»''' [link asio.reference.basic_socket_iostream.expires_at.overload1 more...]]`` @@ -32961,17 +34303,17 @@ void ``[link asio.reference.basic_socket_iostream.expires_at.overload2 expires_at]``( - const time_type & expiry_time); + const time_point & expiry_time); `` [''''»''' [link asio.reference.basic_socket_iostream.expires_at.overload2 more...]]`` [section:overload1 basic_socket_iostream::expires_at (1 of 2 overloads)] -Get the stream's expiry time as an absolute time. +(Deprecated: Use `expiry()`.) Get the stream's expiry time as an absolute time. - time_type expires_at() const; + time_point expires_at() const; @@ -32993,7 +34335,7 @@ void expires_at( - const time_type & expiry_time); + const time_point & expiry_time); This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. @@ -33019,28 +34361,28 @@ [section:expires_from_now basic_socket_iostream::expires_from_now] [indexterm2 expires_from_now..basic_socket_iostream] -Get the timer's expiry time relative to now. +(Deprecated: Use `expiry()`.) Get the stream's expiry time relative to now. - duration_type ``[link asio.reference.basic_socket_iostream.expires_from_now.overload1 expires_from_now]``() const; + duration ``[link asio.reference.basic_socket_iostream.expires_from_now.overload1 expires_from_now]``() const; `` [''''»''' [link asio.reference.basic_socket_iostream.expires_from_now.overload1 more...]]`` -Set the stream's expiry time relative to now. +(Deprecated: Use `expires_after()`.) Set the stream's expiry time relative to now. void ``[link asio.reference.basic_socket_iostream.expires_from_now.overload2 expires_from_now]``( - const duration_type & expiry_time); + const duration & expiry_time); `` [''''»''' [link asio.reference.basic_socket_iostream.expires_from_now.overload2 more...]]`` [section:overload1 basic_socket_iostream::expires_from_now (1 of 2 overloads)] -Get the timer's expiry time relative to now. +(Deprecated: Use `expiry()`.) Get the stream's expiry time relative to now. - duration_type expires_from_now() const; + duration expires_from_now() const; @@ -33058,11 +34400,11 @@ [section:overload2 basic_socket_iostream::expires_from_now (2 of 2 overloads)] -Set the stream's expiry time relative to now. +(Deprecated: Use `expires_after()`.) Set the stream's expiry time relative to now. void expires_from_now( - const duration_type & expiry_time); + const duration & expiry_time); This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. @@ -33086,6 +34428,27 @@ [endsect] +[section:expiry basic_socket_iostream::expiry] + +[indexterm2 expiry..basic_socket_iostream] +Get the stream's expiry time as an absolute time. + + + time_point expiry() const; + + + +[heading Return Value] + +An absolute time value representing the stream's expiry time. + + + + +[endsect] + + + [section:rdbuf basic_socket_iostream::rdbuf] [indexterm2 rdbuf..basic_socket_iostream] @@ -33100,10 +34463,31 @@ +[section:time_point basic_socket_iostream::time_point] + +[indexterm2 time_point..basic_socket_iostream] +The time type. + + + typedef TimeTraits::time_point time_point; + + + +[heading Requirements] + +['Header: ][^asio/basic_socket_iostream.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:time_type basic_socket_iostream::time_type] [indexterm2 time_type..basic_socket_iostream] -The time type. +(Deprecated: Use time\_point.) The time type. typedef TimeTraits::time_type time_type; @@ -33173,13 +34557,20 @@ [ - [[link asio.reference.basic_socket_streambuf.duration_type [*duration_type]]] + [[link asio.reference.basic_socket_streambuf.duration [*duration]]] [The duration type. ] ] [ + [[link asio.reference.basic_socket_streambuf.duration_type [*duration_type]]] + [(Deprecated: Use duration.) The duration type. ] + + ] + + [ + [[link asio.reference.basic_socket_streambuf.enable_connection_aborted [*enable_connection_aborted]]] [Socket option to report aborted connections on accept. ] @@ -33194,6 +34585,13 @@ [ + [[link asio.reference.basic_socket_streambuf.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket_streambuf.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -33236,20 +34634,6 @@ [ - [[link asio.reference.basic_socket_streambuf.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket_streambuf.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket_streambuf.protocol_type [*protocol_type]]] [The protocol type. ] @@ -33306,11 +34690,25 @@ [ - [[link asio.reference.basic_socket_streambuf.time_type [*time_type]]] + [[link asio.reference.basic_socket_streambuf.time_point [*time_point]]] [The time type. ] ] + [ + + [[link asio.reference.basic_socket_streambuf.time_type [*time_type]]] + [(Deprecated: Use time_point.) The time type. ] + + ] + + [ + + [[link asio.reference.basic_socket_streambuf.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -33328,6 +34726,11 @@ ] [ + [[link asio.reference.basic_socket_streambuf.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_socket_streambuf.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -33367,22 +34770,39 @@ ] [ - [[link asio.reference.basic_socket_streambuf.expires_at [*expires_at]]] - [Get the stream buffer's expiry time as an absolute time. - - Set the stream buffer's expiry time as an absolute time. ] + [[link asio.reference.basic_socket_streambuf.expires_after [*expires_after]]] + [Set the stream buffer's expiry time relative to now. ] ] [ - [[link asio.reference.basic_socket_streambuf.expires_from_now [*expires_from_now]]] - [Get the stream buffer's expiry time relative to now. + [[link asio.reference.basic_socket_streambuf.expires_at [*expires_at]]] + [(Deprecated: Use expiry().) Get the stream buffer's expiry time as an absolute time. + + Set the stream buffer's expiry time as an absolute time. Set the stream buffer's expiry time relative to now. ] ] [ + [[link asio.reference.basic_socket_streambuf.expires_from_now [*expires_from_now]]] + [(Deprecated: Use expiry().) Get the stream buffer's expiry time relative to now. + + (Deprecated: Use expires_after().) Set the stream buffer's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_socket_streambuf.expiry [*expiry]]] + [Get the stream buffer's expiry time as an absolute time. ] + ] + + [ + [[link asio.reference.basic_socket_streambuf.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_streambuf.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -33413,11 +34833,6 @@ ] [ - [[link asio.reference.basic_socket_streambuf.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket_streambuf.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -33462,6 +34877,11 @@ ] [ + [[link asio.reference.basic_socket_streambuf.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_socket_streambuf._basic_socket_streambuf [*~basic_socket_streambuf]]] [Destructor flushes buffered data. ] ] @@ -33540,22 +34960,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket_streambuf.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket_streambuf.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - [heading Friends] [table [[Name][Description]] @@ -33704,6 +35108,71 @@ [endsect] + +[section:async_wait basic_socket_streambuf::async_wait] + + +['Inherited from basic_socket.] + +[indexterm2 async_wait..basic_socket_streambuf] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + [section:at_mark basic_socket_streambuf::at_mark] [indexterm2 at_mark..basic_socket_streambuf] @@ -34575,10 +36044,31 @@ +[section:duration basic_socket_streambuf::duration] + +[indexterm2 duration..basic_socket_streambuf] +The duration type. + + + typedef TimeTraits::duration duration; + + + +[heading Requirements] + +['Header: ][^asio/basic_socket_streambuf.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:duration_type basic_socket_streambuf::duration_type] [indexterm2 duration_type..basic_socket_streambuf] -The duration type. +(Deprecated: Use duration.) The duration type. typedef TimeTraits::duration_type duration_type; @@ -34691,13 +36181,123 @@ [endsect] + +[section:executor_type basic_socket_streambuf::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_socket_streambuf] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_socket_streambuf.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:expires_after basic_socket_streambuf::expires_after] + +[indexterm2 expires_after..basic_socket_streambuf] +Set the stream buffer's expiry time relative to now. + + + void expires_after( + const duration & expiry_time); + + +This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. + + +[heading Parameters] + + +[variablelist + +[[expiry_time][The expiry time to be used for the timer. ]] + +] + + + + +[endsect] + + [section:expires_at basic_socket_streambuf::expires_at] [indexterm2 expires_at..basic_socket_streambuf] -Get the stream buffer's expiry time as an absolute time. +(Deprecated: Use `expiry()`.) Get the stream buffer's expiry time as an absolute time. - time_type ``[link asio.reference.basic_socket_streambuf.expires_at.overload1 expires_at]``() const; + time_point ``[link asio.reference.basic_socket_streambuf.expires_at.overload1 expires_at]``() const; `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_at.overload1 more...]]`` @@ -34705,17 +36305,25 @@ void ``[link asio.reference.basic_socket_streambuf.expires_at.overload2 expires_at]``( - const time_type & expiry_time); + const time_point & expiry_time); `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_at.overload2 more...]]`` -[section:overload1 basic_socket_streambuf::expires_at (1 of 2 overloads)] +Set the stream buffer's expiry time relative to now. -Get the stream buffer's expiry time as an absolute time. + void ``[link asio.reference.basic_socket_streambuf.expires_at.overload3 expires_at]``( + const duration & expiry_time); + `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_at.overload3 more...]]`` - time_type expires_at() const; +[section:overload1 basic_socket_streambuf::expires_at (1 of 3 overloads)] + + +(Deprecated: Use `expiry()`.) Get the stream buffer's expiry time as an absolute time. + + + time_point expires_at() const; @@ -34730,14 +36338,14 @@ -[section:overload2 basic_socket_streambuf::expires_at (2 of 2 overloads)] +[section:overload2 basic_socket_streambuf::expires_at (2 of 3 overloads)] Set the stream buffer's expiry time as an absolute time. void expires_at( - const time_type & expiry_time); + const time_point & expiry_time); This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. @@ -34758,55 +36366,15 @@ [endsect] -[endsect] -[section:expires_from_now basic_socket_streambuf::expires_from_now] - -[indexterm2 expires_from_now..basic_socket_streambuf] -Get the stream buffer's expiry time relative to now. - - - duration_type ``[link asio.reference.basic_socket_streambuf.expires_from_now.overload1 expires_from_now]``() const; - `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_from_now.overload1 more...]]`` +[section:overload3 basic_socket_streambuf::expires_at (3 of 3 overloads)] Set the stream buffer's expiry time relative to now. - void ``[link asio.reference.basic_socket_streambuf.expires_from_now.overload2 expires_from_now]``( - const duration_type & expiry_time); - `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_from_now.overload2 more...]]`` - - -[section:overload1 basic_socket_streambuf::expires_from_now (1 of 2 overloads)] - - -Get the stream buffer's expiry time relative to now. - - - duration_type expires_from_now() const; - - - -[heading Return Value] - -A relative time value representing the stream buffer's expiry time. - - - - -[endsect] - - - -[section:overload2 basic_socket_streambuf::expires_from_now (2 of 2 overloads)] - - -Set the stream buffer's expiry time relative to now. - - - void expires_from_now( - const duration_type & expiry_time); + void expires_at( + const duration & expiry_time); This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. @@ -34829,6 +36397,113 @@ [endsect] +[section:expires_from_now basic_socket_streambuf::expires_from_now] + +[indexterm2 expires_from_now..basic_socket_streambuf] +(Deprecated: Use `expiry()`.) Get the stream buffer's expiry time relative to now. + + + duration ``[link asio.reference.basic_socket_streambuf.expires_from_now.overload1 expires_from_now]``() const; + `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_from_now.overload1 more...]]`` + + +(Deprecated: Use `expires_after()`.) Set the stream buffer's expiry time relative to now. + + + void ``[link asio.reference.basic_socket_streambuf.expires_from_now.overload2 expires_from_now]``( + const duration & expiry_time); + `` [''''»''' [link asio.reference.basic_socket_streambuf.expires_from_now.overload2 more...]]`` + + +[section:overload1 basic_socket_streambuf::expires_from_now (1 of 2 overloads)] + + +(Deprecated: Use `expiry()`.) Get the stream buffer's expiry time relative to now. + + + duration expires_from_now() const; + + + +[heading Return Value] + +A relative time value representing the stream buffer's expiry time. + + + + +[endsect] + + + +[section:overload2 basic_socket_streambuf::expires_from_now (2 of 2 overloads)] + + +(Deprecated: Use `expires_after()`.) Set the stream buffer's expiry time relative to now. + + + void expires_from_now( + const duration & expiry_time); + + +This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `asio::error::operation_aborted`. + + +[heading Parameters] + + +[variablelist + +[[expiry_time][The expiry time to be used for the timer. ]] + +] + + + + +[endsect] + + +[endsect] + + +[section:expiry basic_socket_streambuf::expiry] + +[indexterm2 expiry..basic_socket_streambuf] +Get the stream buffer's expiry time as an absolute time. + + + time_point expiry() const; + + + +[heading Return Value] + +An absolute time value representing the stream buffer's expiry time. + + + + +[endsect] + + + +[section:get_executor basic_socket_streambuf::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_socket_streambuf] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_socket_streambuf::get_implementation] [indexterm2 get_implementation..basic_socket_streambuf] @@ -34884,7 +36559,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket_streambuf] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -35085,23 +36760,6 @@ [endsect] -[section:implementation basic_socket_streambuf::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_socket_streambuf] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_socket_streambuf::implementation_type] @@ -35650,6 +37308,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -35692,20 +37357,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -35760,6 +37411,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -35777,6 +37435,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -35822,8 +37485,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -35854,11 +37522,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -35904,6 +37567,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -35958,22 +37626,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -36106,25 +37758,6 @@ -[section:native basic_socket_streambuf::native] - - -['Inherited from basic_socket.] - -[indexterm2 native..basic_socket_streambuf] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_socket_streambuf::native_handle] @@ -36257,7 +37890,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -36281,7 +37914,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -36372,7 +38005,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -36396,7 +38029,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -36480,7 +38113,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -36504,7 +38137,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -36518,30 +38151,6 @@ [endsect] - -[section:native_type basic_socket_streambuf::native_type] - - -['Inherited from basic_socket.] - -[indexterm2 native_type..basic_socket_streambuf] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef StreamSocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_socket_streambuf.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_socket_streambuf::non_blocking] [indexterm2 non_blocking..basic_socket_streambuf] @@ -36678,48 +38287,6 @@ [endsect] - -[section:non_blocking_io basic_socket_streambuf::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_socket_streambuf] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_socket_streambuf.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_socket_streambuf::open] [indexterm2 open..basic_socket_streambuf] @@ -37287,30 +38854,6 @@ -[section:service basic_socket_streambuf::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_socket_streambuf] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_socket_streambuf::service_type] @@ -37656,10 +39199,31 @@ +[section:time_point basic_socket_streambuf::time_point] + +[indexterm2 time_point..basic_socket_streambuf] +The time type. + + + typedef TimeTraits::time_point time_point; + + + +[heading Requirements] + +['Header: ][^asio/basic_socket_streambuf.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:time_type basic_socket_streambuf::time_type] [indexterm2 time_type..basic_socket_streambuf] -The time type. +(Deprecated: Use time\_point.) The time type. typedef TimeTraits::time_type time_type; @@ -37706,6 +39270,158 @@ [endsect] +[section:wait basic_socket_streambuf::wait] + +[indexterm2 wait..basic_socket_streambuf] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_socket_streambuf.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_socket_streambuf.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_socket_streambuf.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket_streambuf.wait.overload2 more...]]`` + + +[section:overload1 basic_socket_streambuf::wait (1 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_socket_streambuf::wait (2 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_socket_streambuf::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_socket_streambuf] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_socket_streambuf] +[indexterm2 wait_write..basic_socket_streambuf] +[indexterm2 wait_error..basic_socket_streambuf] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf] @@ -37784,6 +39500,13 @@ [ + [[link asio.reference.basic_stream_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_stream_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -37826,20 +39549,6 @@ [ - [[link asio.reference.basic_stream_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_stream_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -37894,6 +39603,13 @@ ] + [ + + [[link asio.reference.basic_stream_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -37926,6 +39642,11 @@ ] [ + [[link asio.reference.basic_stream_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 asio.reference.basic_stream_socket.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -37976,8 +39697,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -38008,11 +39734,6 @@ ] [ - [[link asio.reference.basic_stream_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_stream_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -38076,6 +39797,11 @@ ] [ + [[link asio.reference.basic_stream_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_stream_socket.write_some [*write_some]]] [Write some data to the socket. ] ] @@ -38129,22 +39855,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_stream_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_stream_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality. @@ -38631,6 +40341,71 @@ [endsect] +[section:async_wait basic_stream_socket::async_wait] + + +['Inherited from basic_socket.] + +[indexterm2 async_wait..basic_stream_socket] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::ip::tcp::socket socket(io_service); + ... + socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); + + + + + + + +[endsect] + + + [section:async_write_some basic_stream_socket::async_write_some] [indexterm2 async_write_some..basic_stream_socket] @@ -39908,6 +41683,104 @@ [endsect] + +[section:executor_type basic_stream_socket::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_stream_socket] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_stream_socket.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor basic_stream_socket::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_stream_socket] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_stream_socket::get_implementation] [indexterm2 get_implementation..basic_stream_socket] @@ -39963,7 +41836,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_stream_socket] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -40164,23 +42037,6 @@ [endsect] -[section:implementation basic_stream_socket::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_stream_socket] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_stream_socket::implementation_type] @@ -40711,6 +42567,13 @@ [ + [[link asio.reference.basic_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -40753,20 +42616,6 @@ [ - [[link asio.reference.basic_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -40821,6 +42670,13 @@ ] + [ + + [[link asio.reference.basic_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -40838,6 +42694,11 @@ ] [ + [[link asio.reference.basic_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 asio.reference.basic_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -40883,8 +42744,13 @@ ] [ + [[link asio.reference.basic_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -40915,11 +42781,6 @@ ] [ - [[link asio.reference.basic_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -40965,6 +42826,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -41019,22 +42885,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets. @@ -41167,25 +43017,6 @@ -[section:native basic_stream_socket::native] - - -['Inherited from basic_socket.] - -[indexterm2 native..basic_stream_socket] -(Deprecated: Use `native_handle()`.) Get the native socket representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle basic_stream_socket::native_handle] @@ -41315,7 +43146,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -41339,7 +43170,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -41430,7 +43261,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -41454,7 +43285,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -41538,7 +43369,7 @@ || ec == asio::error::try_again) { // We have to wait for the socket to become ready again. - sock_.async_write_some(asio::null_buffers(), *this); + sock_.async_wait(tcp::socket::wait_write, *this); return; } @@ -41562,7 +43393,7 @@ void async_sendfile(tcp::socket& sock, int fd, Handler h) { sendfile_op<Handler> op = { sock, fd, h, 0, 0 }; - sock.async_write_some(asio::null_buffers(), op); + sock.async_wait(tcp::socket::wait_write, op); } @@ -41576,27 +43407,6 @@ [endsect] - -[section:native_type basic_stream_socket::native_type] - -[indexterm2 native_type..basic_stream_socket] -(Deprecated: Use native\_handle\_type.) The native representation of a socket. - - - typedef StreamSocketService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/basic_stream_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking basic_stream_socket::non_blocking] [indexterm2 non_blocking..basic_stream_socket] @@ -41733,48 +43543,6 @@ [endsect] - -[section:non_blocking_io basic_stream_socket::non_blocking_io] - - -['Inherited from socket_base.] - -[indexterm2 non_blocking_io..basic_stream_socket] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/basic_stream_socket.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:open basic_stream_socket::open] [indexterm2 open..basic_stream_socket] @@ -42931,30 +44699,6 @@ -[section:service basic_stream_socket::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..basic_stream_socket] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type basic_stream_socket::service_type] @@ -43273,6 +45017,158 @@ [endsect] +[section:wait basic_stream_socket::wait] + +[indexterm2 wait..basic_stream_socket] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.basic_stream_socket.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.basic_stream_socket.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.basic_stream_socket.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_stream_socket.wait.overload2 more...]]`` + + +[section:overload1 basic_stream_socket::wait (1 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + socket.wait(asio::ip::tcp::socket::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 basic_stream_socket::wait (2 of 2 overloads)] + + +['Inherited from basic_socket.] + + +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a socket to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired socket state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a socket to become readable. + + asio::ip::tcp::socket socket(io_service); + ... + asio::error_code ec; + socket.wait(asio::ip::tcp::socket::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type basic_stream_socket::wait_type] + + +['Inherited from socket_base.] + +[indexterm2 wait_type..basic_stream_socket] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..basic_stream_socket] +[indexterm2 wait_write..basic_stream_socket] +[indexterm2 wait_error..basic_stream_socket] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + [section:write_some basic_stream_socket::write_some] [indexterm2 write_some..basic_stream_socket] @@ -43872,6 +45768,13 @@ [ + [[link asio.reference.basic_waitable_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_waitable_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -43915,7 +45818,9 @@ Constructor to set a particular expiry time as an absolute time. - Constructor to set a particular expiry time relative to now. ] + Constructor to set a particular expiry time relative to now. + + Move-construct a basic_waitable_timer from another. ] ] [ @@ -43929,22 +45834,42 @@ ] [ + [[link asio.reference.basic_waitable_timer.expires_after [*expires_after]]] + [Set the timer's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_waitable_timer.expires_at [*expires_at]]] - [Get the timer's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the timer's expiry time as an absolute time. Set the timer's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_waitable_timer.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the timer's expiry time relative to now. - Set the timer's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the timer's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.expiry [*expiry]]] + [Get the timer's expiry time as an absolute time. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] ] [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.operator_eq_ [*operator=]]] + [Move-assign a basic_waitable_timer from another. ] ] [ @@ -43970,22 +45895,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_waitable_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_waitable_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_waitable_timer `basic_waitable_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A waitable timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -44013,7 +45922,7 @@ asio::steady_timer timer(io_service); // Set an expiry time relative to now. - timer.expires_from_now(std::chrono::seconds(5)); + timer.expires_after(std::chrono::seconds(5)); // Wait for the timer to expire. timer.wait(); @@ -44055,7 +45964,7 @@ void on_some_event() { - if (my_timer.expires_from_now(seconds(5)) > 0) + if (my_timer.expires_after(seconds(5)) > 0) { // We managed to cancel the timer. Start new asynchronous wait. my_timer.async_wait(on_timeout); @@ -44078,7 +45987,7 @@ -* The `asio::basic_waitable_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. +* The `asio::basic_waitable_timer::expires_after()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. * If a wait handler is cancelled, the [link asio.reference.error_code `error_code`] passed to it contains the value `asio::error::operation_aborted`. @@ -44165,7 +46074,15 @@ `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload3 more...]]`` -[section:overload1 basic_waitable_timer::basic_waitable_timer (1 of 3 overloads)] +Move-construct a [link asio.reference.basic_waitable_timer `basic_waitable_timer`] from another. + + + ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload4 basic_waitable_timer]``( + basic_waitable_timer && other); + `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload4 more...]]`` + + +[section:overload1 basic_waitable_timer::basic_waitable_timer (1 of 4 overloads)] Constructor. @@ -44175,7 +46092,7 @@ asio::io_service & io_service); -This constructor creates a timer without setting an expiry time. The `expires_at()` or `expires_from_now()` functions must be called to set an expiry time before the timer can be waited on. +This constructor creates a timer without setting an expiry time. The `expires_at()` or `expires_after()` functions must be called to set an expiry time before the timer can be waited on. [heading Parameters] @@ -44194,7 +46111,7 @@ -[section:overload2 basic_waitable_timer::basic_waitable_timer (2 of 3 overloads)] +[section:overload2 basic_waitable_timer::basic_waitable_timer (2 of 4 overloads)] Constructor to set a particular expiry time as an absolute time. @@ -44226,7 +46143,7 @@ -[section:overload3 basic_waitable_timer::basic_waitable_timer (3 of 3 overloads)] +[section:overload3 basic_waitable_timer::basic_waitable_timer (3 of 4 overloads)] Constructor to set a particular expiry time relative to now. @@ -44257,6 +46174,40 @@ [endsect] + +[section:overload4 basic_waitable_timer::basic_waitable_timer (4 of 4 overloads)] + + +Move-construct a [link asio.reference.basic_waitable_timer `basic_waitable_timer`] from another. + + + basic_waitable_timer( + basic_waitable_timer && other); + + +This constructor moves a timer from one object to another. + + +[heading Parameters] + + +[variablelist + +[[other][The other [link asio.reference.basic_waitable_timer `basic_waitable_timer`] object from which the move will occur.]] + +] + + +[heading Remarks] + +Following the move, the moved-from object is in the same state as if constructed using the `basic_waitable_timer(io_service&) constructor`. + + + + +[endsect] + + [endsect] [section:cancel basic_waitable_timer::cancel] @@ -44517,10 +46468,211 @@ [endsect] + +[section:executor_type basic_waitable_timer::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..basic_waitable_timer] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/basic_waitable_timer.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:expires_after basic_waitable_timer::expires_after] + +[indexterm2 expires_after..basic_waitable_timer] +Set the timer's expiry time relative to now. + + + std::size_t ``[link asio.reference.basic_waitable_timer.expires_after.overload1 expires_after]``( + const duration & expiry_time); + `` [''''»''' [link asio.reference.basic_waitable_timer.expires_after.overload1 more...]]`` + + std::size_t ``[link asio.reference.basic_waitable_timer.expires_after.overload2 expires_after]``( + const duration & expiry_time, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_waitable_timer.expires_after.overload2 more...]]`` + + +[section:overload1 basic_waitable_timer::expires_after (1 of 2 overloads)] + + +Set the timer's expiry time relative to now. + + + std::size_t expires_after( + const duration & expiry_time); + + +This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the `asio::error::operation_aborted` error code. + + +[heading Parameters] + + +[variablelist + +[[expiry_time][The expiry time to be used for the timer.]] + +] + + +[heading Return Value] + +The number of asynchronous operations that were cancelled. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Remarks] + +If the timer has already expired when `expires_after()` is called, then the handlers for asynchronous wait operations will: + + +* have already been invoked; or + + +* have been queued for invocation in the near future. + +These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation. + + +[endsect] + + + +[section:overload2 basic_waitable_timer::expires_after (2 of 2 overloads)] + + +Set the timer's expiry time relative to now. + + + std::size_t expires_after( + const duration & expiry_time, + asio::error_code & ec); + + +This function sets the expiry time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the `asio::error::operation_aborted` error code. + + +[heading Parameters] + + +[variablelist + +[[expiry_time][The expiry time to be used for the timer.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +The number of asynchronous operations that were cancelled. + + +[heading Remarks] + +If the timer has already expired when `expires_after()` is called, then the handlers for asynchronous wait operations will: + + +* have already been invoked; or + + +* have been queued for invocation in the near future. + +These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation. + + +[endsect] + + +[endsect] + [section:expires_at basic_waitable_timer::expires_at] [indexterm2 expires_at..basic_waitable_timer] -Get the timer's expiry time as an absolute time. +(Deprecated: Use `expiry()`.) Get the timer's expiry time as an absolute time. time_point ``[link asio.reference.basic_waitable_timer.expires_at.overload1 expires_at]``() const; @@ -44543,7 +46695,7 @@ [section:overload1 basic_waitable_timer::expires_at (1 of 3 overloads)] -Get the timer's expiry time as an absolute time. +(Deprecated: Use `expiry()`.) Get the timer's expiry time as an absolute time. time_point expires_at() const; @@ -44663,14 +46815,14 @@ [section:expires_from_now basic_waitable_timer::expires_from_now] [indexterm2 expires_from_now..basic_waitable_timer] -Get the timer's expiry time relative to now. +(Deprecated: Use `expiry()`.) Get the timer's expiry time relative to now. duration ``[link asio.reference.basic_waitable_timer.expires_from_now.overload1 expires_from_now]``() const; `` [''''»''' [link asio.reference.basic_waitable_timer.expires_from_now.overload1 more...]]`` -Set the timer's expiry time relative to now. +(Deprecated: Use `expires_after()`.) Set the timer's expiry time relative to now. std::size_t ``[link asio.reference.basic_waitable_timer.expires_from_now.overload2 expires_from_now]``( @@ -44686,7 +46838,7 @@ [section:overload1 basic_waitable_timer::expires_from_now (1 of 3 overloads)] -Get the timer's expiry time relative to now. +(Deprecated: Use `expiry()`.) Get the timer's expiry time relative to now. duration expires_from_now() const; @@ -44702,7 +46854,7 @@ [section:overload2 basic_waitable_timer::expires_from_now (2 of 3 overloads)] -Set the timer's expiry time relative to now. +(Deprecated: Use `expires_after()`.) Set the timer's expiry time relative to now. std::size_t expires_from_now( @@ -44757,7 +46909,7 @@ [section:overload3 basic_waitable_timer::expires_from_now (3 of 3 overloads)] -Set the timer's expiry time relative to now. +(Deprecated: Use `expires_after()`.) Set the timer's expiry time relative to now. std::size_t expires_from_now( @@ -44803,6 +46955,39 @@ [endsect] + +[section:expiry basic_waitable_timer::expiry] + +[indexterm2 expiry..basic_waitable_timer] +Get the timer's expiry time as an absolute time. + + + time_point expiry() const; + + +This function may be used to obtain the timer's current expiry time. Whether the timer has expired or not does not affect this value. + + +[endsect] + + + +[section:get_executor basic_waitable_timer::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..basic_waitable_timer] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation basic_waitable_timer::get_implementation] [indexterm2 get_implementation..basic_waitable_timer] @@ -44858,7 +47043,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_waitable_timer] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -44926,23 +47111,6 @@ [endsect] -[section:implementation basic_waitable_timer::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..basic_waitable_timer] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type basic_waitable_timer::implementation_type] @@ -44967,22 +47135,32 @@ -[section:service basic_waitable_timer::service] +[section:operator_eq_ basic_waitable_timer::operator=] + +[indexterm2 operator=..basic_waitable_timer] +Move-assign a [link asio.reference.basic_waitable_timer `basic_waitable_timer`] from another. -['Inherited from basic_io_object.] - -[indexterm2 service..basic_waitable_timer] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. + basic_waitable_timer & operator=( + basic_waitable_timer && other); - service_type & service; +This assignment operator moves a timer from one object to another. +[heading Parameters] + + +[variablelist + +[[other][The other [link asio.reference.basic_waitable_timer `basic_waitable_timer`] object from which the move will occur.]] + +] + [heading Remarks] -Available only for services that do not support movability. +Following the move, the moved-from object is in the same state as if constructed using the `basic_waitable_timer(io_service&) constructor`. @@ -45168,7 +47346,9 @@ [ [[link asio.reference.basic_yield_context.basic_yield_context [*basic_yield_context]]] - [Construct a yield context to represent the specified coroutine. ] + [Construct a yield context to represent the specified coroutine. + + Construct a yield context from another yield context type. ] ] [ @@ -45199,8 +47379,7 @@ ['Header: ][^asio/spawn.hpp] -['Convenience header: ][^asio.hpp] - +['Convenience header: ]None [section:basic_yield_context basic_yield_context::basic_yield_context] @@ -45208,6 +47387,29 @@ Construct a yield context to represent the specified coroutine. + ``[link asio.reference.basic_yield_context.basic_yield_context.overload1 basic_yield_context]``( + const detail::weak_ptr< callee_type > & coro, + caller_type & ca, + Handler & handler); + `` [''''»''' [link asio.reference.basic_yield_context.basic_yield_context.overload1 more...]]`` + + +Construct a yield context from another yield context type. + + + template< + typename OtherHandler> + ``[link asio.reference.basic_yield_context.basic_yield_context.overload2 basic_yield_context]``( + const basic_yield_context< OtherHandler > & other); + `` [''''»''' [link asio.reference.basic_yield_context.basic_yield_context.overload2 more...]]`` + + +[section:overload1 basic_yield_context::basic_yield_context (1 of 2 overloads)] + + +Construct a yield context to represent the specified coroutine. + + basic_yield_context( const detail::weak_ptr< callee_type > & coro, caller_type & ca, @@ -45221,6 +47423,27 @@ +[section:overload2 basic_yield_context::basic_yield_context (2 of 2 overloads)] + + +Construct a yield context from another yield context type. + + + template< + typename OtherHandler> + basic_yield_context( + const basic_yield_context< OtherHandler > & other); + + +Requires that OtherHandler be convertible to Handler. + + +[endsect] + + +[endsect] + + [section:callee_type basic_yield_context::callee_type] [indexterm2 callee_type..basic_yield_context] @@ -45247,7 +47470,7 @@ ['Header: ][^asio/spawn.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [endsect] @@ -45280,7 +47503,7 @@ ['Header: ][^asio/spawn.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [endsect] @@ -45511,19 +47734,36 @@ typename Elem, typename Traits, typename Allocator> - const_buffers_1 ``[link asio.reference.buffer.overload27 buffer]``( - const std::basic_string< Elem, Traits, Allocator > & data); + mutable_buffers_1 ``[link asio.reference.buffer.overload27 buffer]``( + std::basic_string< Elem, Traits, Allocator > & data); `` [''''»''' [link asio.reference.buffer.overload27 more...]]`` template< typename Elem, typename Traits, typename Allocator> - const_buffers_1 ``[link asio.reference.buffer.overload28 buffer]``( - const std::basic_string< Elem, Traits, Allocator > & data, + mutable_buffers_1 ``[link asio.reference.buffer.overload28 buffer]``( + std::basic_string< Elem, Traits, Allocator > & data, std::size_t max_size_in_bytes); `` [''''»''' [link asio.reference.buffer.overload28 more...]]`` + template< + typename Elem, + typename Traits, + typename Allocator> + const_buffers_1 ``[link asio.reference.buffer.overload29 buffer]``( + const std::basic_string< Elem, Traits, Allocator > & data); + `` [''''»''' [link asio.reference.buffer.overload29 more...]]`` + + template< + typename Elem, + typename Traits, + typename Allocator> + const_buffers_1 ``[link asio.reference.buffer.overload30 buffer]``( + const std::basic_string< Elem, Traits, Allocator > & data, + std::size_t max_size_in_bytes); + `` [''''»''' [link asio.reference.buffer.overload30 more...]]`` + A buffer object represents a contiguous region of memory as a 2-tuple consisting of a pointer and size in bytes. A tuple of the form `{void*, size_t}` specifies a mutable (modifiable) region of memory. Similarly, a tuple of the form `{const void*, size_t}` specifies a const (non-modifiable) region of memory. These two forms correspond to the classes [link asio.reference.mutable_buffer `mutable_buffer`] and [link asio.reference.const_buffer `const_buffer`], respectively. To mirror C++'s conversion rules, a [link asio.reference.mutable_buffer `mutable_buffer`] is implicitly convertible to a [link asio.reference.const_buffer `const_buffer`], and the opposite conversion is not permitted. The simplest use case involves reading or writing a single buffer of a specified size: @@ -45705,7 +47945,7 @@ ['Convenience header: ][^asio.hpp] -[section:overload1 buffer (1 of 28 overloads)] +[section:overload1 buffer (1 of 30 overloads)] Create a new modifiable buffer from an existing buffer. @@ -45727,7 +47967,7 @@ -[section:overload2 buffer (2 of 28 overloads)] +[section:overload2 buffer (2 of 30 overloads)] Create a new modifiable buffer from an existing buffer. @@ -45757,7 +47997,7 @@ -[section:overload3 buffer (3 of 28 overloads)] +[section:overload3 buffer (3 of 30 overloads)] Create a new non-modifiable buffer from an existing buffer. @@ -45779,7 +48019,7 @@ -[section:overload4 buffer (4 of 28 overloads)] +[section:overload4 buffer (4 of 30 overloads)] Create a new non-modifiable buffer from an existing buffer. @@ -45809,7 +48049,7 @@ -[section:overload5 buffer (5 of 28 overloads)] +[section:overload5 buffer (5 of 30 overloads)] Create a new modifiable buffer that represents the given memory range. @@ -45832,7 +48072,7 @@ -[section:overload6 buffer (6 of 28 overloads)] +[section:overload6 buffer (6 of 30 overloads)] Create a new non-modifiable buffer that represents the given memory range. @@ -45855,7 +48095,7 @@ -[section:overload7 buffer (7 of 28 overloads)] +[section:overload7 buffer (7 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -45887,7 +48127,7 @@ -[section:overload8 buffer (8 of 28 overloads)] +[section:overload8 buffer (8 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -45920,7 +48160,7 @@ -[section:overload9 buffer (9 of 28 overloads)] +[section:overload9 buffer (9 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -45952,7 +48192,7 @@ -[section:overload10 buffer (10 of 28 overloads)] +[section:overload10 buffer (10 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -45985,7 +48225,7 @@ -[section:overload11 buffer (11 of 28 overloads)] +[section:overload11 buffer (11 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -46017,7 +48257,7 @@ -[section:overload12 buffer (12 of 28 overloads)] +[section:overload12 buffer (12 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -46050,7 +48290,7 @@ -[section:overload13 buffer (13 of 28 overloads)] +[section:overload13 buffer (13 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46082,7 +48322,7 @@ -[section:overload14 buffer (14 of 28 overloads)] +[section:overload14 buffer (14 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46115,7 +48355,7 @@ -[section:overload15 buffer (15 of 28 overloads)] +[section:overload15 buffer (15 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46147,7 +48387,7 @@ -[section:overload16 buffer (16 of 28 overloads)] +[section:overload16 buffer (16 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46180,7 +48420,7 @@ -[section:overload17 buffer (17 of 28 overloads)] +[section:overload17 buffer (17 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -46212,7 +48452,7 @@ -[section:overload18 buffer (18 of 28 overloads)] +[section:overload18 buffer (18 of 30 overloads)] Create a new modifiable buffer that represents the given POD array. @@ -46245,7 +48485,7 @@ -[section:overload19 buffer (19 of 28 overloads)] +[section:overload19 buffer (19 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46277,7 +48517,7 @@ -[section:overload20 buffer (20 of 28 overloads)] +[section:overload20 buffer (20 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46310,7 +48550,7 @@ -[section:overload21 buffer (21 of 28 overloads)] +[section:overload21 buffer (21 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46342,7 +48582,7 @@ -[section:overload22 buffer (22 of 28 overloads)] +[section:overload22 buffer (22 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD array. @@ -46375,7 +48615,7 @@ -[section:overload23 buffer (23 of 28 overloads)] +[section:overload23 buffer (23 of 30 overloads)] Create a new modifiable buffer that represents the given POD vector. @@ -46412,7 +48652,7 @@ -[section:overload24 buffer (24 of 28 overloads)] +[section:overload24 buffer (24 of 30 overloads)] Create a new modifiable buffer that represents the given POD vector. @@ -46450,7 +48690,7 @@ -[section:overload25 buffer (25 of 28 overloads)] +[section:overload25 buffer (25 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD vector. @@ -46487,7 +48727,7 @@ -[section:overload26 buffer (26 of 28 overloads)] +[section:overload26 buffer (26 of 30 overloads)] Create a new non-modifiable buffer that represents the given POD vector. @@ -46525,7 +48765,77 @@ -[section:overload27 buffer (27 of 28 overloads)] +[section:overload27 buffer (27 of 30 overloads)] + + +Create a new modifiable buffer that represents the given string. + + + template< + typename Elem, + typename Traits, + typename Allocator> + mutable_buffers_1 buffer( + std::basic_string< Elem, Traits, Allocator > & data); + + + +[heading Return Value] + +`mutable_buffers_1(data.size() ? &data[0] : 0, data.size() * sizeof(Elem))`. + + +[heading Remarks] + +The buffer is invalidated by any non-const operation called on the given string object. + + + + +[endsect] + + + +[section:overload28 buffer (28 of 30 overloads)] + + +Create a new non-modifiable buffer that represents the given string. + + + template< + typename Elem, + typename Traits, + typename Allocator> + mutable_buffers_1 buffer( + std::basic_string< Elem, Traits, Allocator > & data, + std::size_t max_size_in_bytes); + + + +[heading Return Value] + +A [link asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to: + + mutable_buffers_1( + data.size() ? &data[0] : 0, + min(data.size() * sizeof(Elem), max_size_in_bytes)); + + + + + +[heading Remarks] + +The buffer is invalidated by any non-const operation called on the given string object. + + + + +[endsect] + + + +[section:overload29 buffer (29 of 30 overloads)] Create a new non-modifiable buffer that represents the given string. @@ -46556,7 +48866,7 @@ -[section:overload28 buffer (28 of 28 overloads)] +[section:overload30 buffer (30 of 30 overloads)] Create a new non-modifiable buffer that represents the given string. @@ -46709,7 +49019,8 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload5 buffer_copy]``( const mutable_buffer & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload5 more...]]`` std::size_t ``[link asio.reference.buffer_copy.overload6 buffer_copy]``( @@ -46736,35 +49047,40 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload10 buffer_copy]``( const mutable_buffers_1 & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload10 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload11 buffer_copy]``( const MutableBufferSequence & target, - const const_buffer & source); + const const_buffer & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload11 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload12 buffer_copy]``( const MutableBufferSequence & target, - const const_buffers_1 & source); + const const_buffers_1 & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload12 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload13 buffer_copy]``( const MutableBufferSequence & target, - const mutable_buffer & source); + const mutable_buffer & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload13 more...]]`` template< typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload14 buffer_copy]``( const MutableBufferSequence & target, - const mutable_buffers_1 & source); + const mutable_buffers_1 & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload14 more...]]`` template< @@ -46772,7 +49088,8 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t ``[link asio.reference.buffer_copy.overload15 buffer_copy]``( const MutableBufferSequence & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value &&is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload15 more...]]`` std::size_t ``[link asio.reference.buffer_copy.overload16 buffer_copy]``( @@ -46804,7 +49121,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload20 buffer_copy]``( const mutable_buffer & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload20 more...]]`` std::size_t ``[link asio.reference.buffer_copy.overload21 buffer_copy]``( @@ -46836,7 +49154,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload25 buffer_copy]``( const mutable_buffers_1 & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload25 more...]]`` template< @@ -46844,7 +49163,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload26 buffer_copy]``( const MutableBufferSequence & target, const const_buffer & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload26 more...]]`` template< @@ -46852,7 +49172,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload27 buffer_copy]``( const MutableBufferSequence & target, const const_buffers_1 & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload27 more...]]`` template< @@ -46860,7 +49181,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload28 buffer_copy]``( const MutableBufferSequence & target, const mutable_buffer & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload28 more...]]`` template< @@ -46868,7 +49190,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload29 buffer_copy]``( const MutableBufferSequence & target, const mutable_buffers_1 & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload29 more...]]`` template< @@ -46877,7 +49200,8 @@ std::size_t ``[link asio.reference.buffer_copy.overload30 buffer_copy]``( const MutableBufferSequence & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value &&is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_copy.overload30 more...]]`` The `buffer_copy` function is available in two forms: @@ -47104,7 +49428,8 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t buffer_copy( const mutable_buffer & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -47336,7 +49661,8 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t buffer_copy( const mutable_buffers_1 & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -47384,7 +49710,8 @@ typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t buffer_copy( const MutableBufferSequence & target, - const const_buffer & source); + const const_buffer & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -47432,7 +49759,8 @@ typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t buffer_copy( const MutableBufferSequence & target, - const const_buffers_1 & source); + const const_buffers_1 & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -47480,7 +49808,8 @@ typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t buffer_copy( const MutableBufferSequence & target, - const mutable_buffer & source); + const mutable_buffer & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -47528,7 +49857,8 @@ typename ``[link asio.reference.MutableBufferSequence MutableBufferSequence]``> std::size_t buffer_copy( const MutableBufferSequence & target, - const mutable_buffers_1 & source); + const mutable_buffers_1 & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -47577,7 +49907,8 @@ typename ``[link asio.reference.ConstBufferSequence ConstBufferSequence]``> std::size_t buffer_copy( const MutableBufferSequence & target, - const ConstBufferSequence & source); + const ConstBufferSequence & source, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value &&is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -47834,7 +50165,8 @@ std::size_t buffer_copy( const mutable_buffer & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -48096,7 +50428,8 @@ std::size_t buffer_copy( const mutable_buffers_1 & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -48150,7 +50483,8 @@ std::size_t buffer_copy( const MutableBufferSequence & target, const const_buffer & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -48204,7 +50538,8 @@ std::size_t buffer_copy( const MutableBufferSequence & target, const const_buffers_1 & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -48258,7 +50593,8 @@ std::size_t buffer_copy( const MutableBufferSequence & target, const mutable_buffer & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -48312,7 +50648,8 @@ std::size_t buffer_copy( const MutableBufferSequence & target, const mutable_buffers_1 & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value >::type * = 0); @@ -48367,7 +50704,8 @@ std::size_t buffer_copy( const MutableBufferSequence & target, const ConstBufferSequence & source, - std::size_t max_bytes_to_copy); + std::size_t max_bytes_to_copy, + typename enable_if< is_mutable_buffer_sequence< MutableBufferSequence >::value &&is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); @@ -48436,7 +50774,8 @@ template< typename BufferSequence> std::size_t ``[link asio.reference.buffer_size.overload5 buffer_size]``( - const BufferSequence & b); + const BufferSequence & b, + typename enable_if< is_const_buffer_sequence< BufferSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.buffer_size.overload5 more...]]`` [heading Requirements] @@ -48515,7 +50854,8 @@ template< typename BufferSequence> std::size_t buffer_size( - const BufferSequence & b); + const BufferSequence & b, + typename enable_if< is_const_buffer_sequence< BufferSequence >::value >::type * = 0); The `BufferSequence` template parameter may meet either of the `ConstBufferSequence` or `MutableBufferSequence` type requirements. @@ -53132,13 +55472,6 @@ [ - [[link asio.reference.datagram_socket_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native socket type. ] - - ] - - [ - [[link asio.reference.datagram_socket_service.protocol_type [*protocol_type]]] [The protocol type. ] @@ -53181,6 +55514,11 @@ ] [ + [[link asio.reference.datagram_socket_service.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.datagram_socket_service.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -53266,11 +55604,6 @@ ] [ - [[link asio.reference.datagram_socket_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket implementation. ] - ] - - [ [[link asio.reference.datagram_socket_service.native_handle [*native_handle]]] [Get the native socket implementation. ] ] @@ -53329,6 +55662,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.datagram_socket_service.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Data Members] @@ -53472,6 +55810,25 @@ +[section:async_wait datagram_socket_service::async_wait] + +[indexterm2 async_wait..datagram_socket_service] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + implementation_type & impl, + socket_base::wait_type w, + WaitHandler handler); + + + +[endsect] + + + [section:at_mark datagram_socket_service::at_mark] [indexterm2 at_mark..datagram_socket_service] @@ -53807,21 +56164,6 @@ -[section:native datagram_socket_service::native] - -[indexterm2 native..datagram_socket_service] -(Deprecated: Use `native_handle()`.) Get the native socket implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle datagram_socket_service::native_handle] [indexterm2 native_handle..datagram_socket_service] @@ -53911,27 +56253,6 @@ [endsect] - -[section:native_type datagram_socket_service::native_type] - -[indexterm2 native_type..datagram_socket_service] -(Deprecated: Use native\_handle\_type.) The native socket type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/datagram_socket_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking datagram_socket_service::non_blocking] [indexterm2 non_blocking..datagram_socket_service] @@ -54157,6 +56478,23 @@ +[section:wait datagram_socket_service::wait] + +[indexterm2 wait..datagram_socket_service] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + implementation_type & impl, + socket_base::wait_type w, + asio::error_code & ec); + + + +[endsect] + + + [endsect] @@ -54182,6 +56520,13 @@ [ + [[link asio.reference.basic_deadline_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -54253,8 +56598,13 @@ ] [ + [[link asio.reference.basic_deadline_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -54280,22 +56630,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_deadline_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_deadline_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_deadline_timer `basic_deadline_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A deadline timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -54858,6 +57192,318 @@ [endsect] +[section:defer defer] + +[indexterm1 defer] +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.defer.overload1 defer]``( + CompletionToken token); + `` [''''»''' [link asio.reference.defer.overload1 more...]]`` + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.defer.overload2 defer]``( + const Executor & ex, + CompletionToken token, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.defer.overload2 more...]]`` + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.defer.overload3 defer]``( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.defer.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^asio/defer.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 defer (1 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` defer( + CompletionToken token); + + +This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex` by performing `get_associated_executor(handler)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Performs `ex.defer(std::move(handler), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload2 defer (2 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` defer( + const Executor & ex, + CompletionToken token, + typename enable_if< 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()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex1` by performing `get_associated_executor(handler)`. + + +* Creates a work object `w` by performing `make_work(ex1)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Constructs a function object `f` with a function call operator that performs `ex1.dispatch(std::move(handler), alloc)` followed by `w.reset()`. + + +* Performs `Executor(ex).defer(std::move(f), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload3 defer (3 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` defer( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[heading Return Value] + +`defer(ctx.get_executor(), forward<CompletionToken>(token))`. + + + + +[endsect] + + +[endsect] + +[section:dispatch dispatch] + +[indexterm1 dispatch] +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.dispatch.overload1 dispatch]``( + CompletionToken token); + `` [''''»''' [link asio.reference.dispatch.overload1 more...]]`` + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.dispatch.overload2 dispatch]``( + const Executor & ex, + CompletionToken token, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.dispatch.overload2 more...]]`` + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.dispatch.overload3 dispatch]``( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.dispatch.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^asio/dispatch.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 dispatch (1 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` dispatch( + CompletionToken token); + + +This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `dispatch()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex` by performing `get_associated_executor(handler)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Performs `ex.dispatch(std::move(handler), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload2 dispatch (2 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` dispatch( + const Executor & ex, + CompletionToken token, + typename enable_if< 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 `dispatch()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex1` by performing `get_associated_executor(handler)`. + + +* Creates a work object `w` by performing `make_work(ex1)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Constructs a function object `f` with a function call operator that performs `ex1.dispatch(std::move(handler), alloc)` followed by `w.reset()`. + + +* Performs `Executor(ex).dispatch(std::move(f), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload3 dispatch (3 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` dispatch( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[heading Return Value] + +`dispatch(ctx.get_executor(), forward<CompletionToken>(token))`. + + + + +[endsect] + + +[endsect] + [section:error__addrinfo_category error::addrinfo_category] @@ -55968,6 +58614,2444 @@ [endsect] +[section:execution_context execution_context] + + +A context for function object execution. + + + class execution_context : + noncopyable + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.execution_context__id [*id]]] + [Class used to uniquely identify a service. ] + + ] + + [ + + [[link asio.reference.execution_context__service [*service]]] + [Base class for all io_service services. ] + + ] + + [ + + [[link asio.reference.execution_context.fork_event [*fork_event]]] + [Fork-related event notifications. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context.notify_fork [*notify_fork]]] + [Notify the execution_context of a fork-related event. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context.destroy_context [*destroy_context]]] + [Destroys all services in the context. ] + ] + + [ + [[link asio.reference.execution_context.execution_context [*execution_context]]] + [Constructor. ] + ] + + [ + [[link asio.reference.execution_context.shutdown_context [*shutdown_context]]] + [Shuts down all services in the context. ] + ] + + [ + [[link asio.reference.execution_context._execution_context [*~execution_context]]] + [Destructor. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context.add_service [*add_service]]] + [Add a service object to the execution_context. ] + ] + + [ + [[link asio.reference.execution_context.has_service [*has_service]]] + [Determine if an execution_context contains a specified service type. ] + ] + + [ + [[link asio.reference.execution_context.use_service [*use_service]]] + [Obtain the service object corresponding to the given type. ] + ] + +] + +An execution context represents a place where function objects will be executed. An `io_service` is an example of an execution context. + + +[heading The execution_context class and services] + + + +Class [link asio.reference.execution_context `execution_context`] implements an extensible, type-safe, polymorphic set of services, indexed by service type. + +Services exist to manage the resources that are shared across an execution context. For example, timers may be implemented in terms of a single timer queue, and this queue would be stored in a service. + +Access to the services of an [link asio.reference.execution_context `execution_context`] is via three function templates, `use_service()`, `add_service()` and `has_service()`. + +In a call to `use_service<Service>()`, the type argument chooses a service, making available all members of the named type. If `Service` is not present in an [link asio.reference.execution_context `execution_context`], an object of type `Service` is created and added to the [link asio.reference.execution_context `execution_context`]. A C++ program can check if an [link asio.reference.execution_context `execution_context`] implements a particular service with the function template `has_service<Service>()`. + +Service objects may be explicitly added to an [link asio.reference.execution_context `execution_context`] using the function template `add_service<Service>()`. If the `Service` is already present, the [link asio.reference.service_already_exists `service_already_exists`] exception is thrown. If the owner of the service is not the same object as the [link asio.reference.execution_context `execution_context`] parameter, the [link asio.reference.invalid_service_owner `invalid_service_owner`] exception is thrown. + +Once a service reference is obtained from an [link asio.reference.execution_context `execution_context`] object by calling `use_service()`, that reference remains usable as long as the owning [link asio.reference.execution_context `execution_context`] object exists. + +All service implementations have [link asio.reference.execution_context__service `execution_context::service`] as a public base class. Custom services may be implemented by deriving from this class and then added to an [link asio.reference.execution_context `execution_context`] using the facilities described above. + + +[heading The execution_context as a base class] + + + +Class [link asio.reference.execution_context `execution_context`] may be used only as a base class for concrete execution context types. The `io_service` is an example of such a derived type. + +On destruction, a class that is derived from [link asio.reference.execution_context `execution_context`] must perform `execution_context::shutdown_context()` followed by `execution_context::destroy_context()`. + +This destruction sequence permits programs to simplify their resource management by using `shared_ptr<>`. Where an object's lifetime is tied to the lifetime of a connection (or some other sequence of asynchronous operations), a `shared_ptr` to the object would be bound into the handlers for all asynchronous operations associated with it. This works as follows: + + +* When a single connection ends, all associated asynchronous operations complete. The corresponding handler objects are destroyed, and all `shared_ptr` references to the objects are destroyed. + + +* To shut down the whole program, the [link asio.reference.io_service `io_service`] function stop() is called to terminate any run() calls as soon as possible. The [link asio.reference.io_service `io_service`] destructor calls `shutdown_context()` and `destroy_context()` to destroy all pending handlers, causing all `shared_ptr` references to all connection objects to be destroyed. + + + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:add_service execution_context::add_service] + +[indexterm2 add_service..execution_context] +Add a service object to the [link asio.reference.execution_context `execution_context`]. + + + template< + typename ``[link asio.reference.Service Service]``> + friend void add_service( + execution_context & e, + Service * svc); + + +This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: +`` + delete static_cast<execution_context::service*>(svc) +`` +]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] + +[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] + +] + + + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:destroy_context execution_context::destroy_context] + +[indexterm2 destroy_context..execution_context] +Destroys all services in the context. + + + void destroy_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order * of the beginning of service object lifetime, performs `delete static_cast<execution_context::service*>(svc)`. + + + + +[endsect] + + + +[section:execution_context execution_context::execution_context] + +[indexterm2 execution_context..execution_context] +Constructor. + + + execution_context(); + + + +[endsect] + + + +[section:fork_event execution_context::fork_event] + +[indexterm2 fork_event..execution_context] +Fork-related event notifications. + + + enum fork_event + +[indexterm2 fork_prepare..execution_context] +[indexterm2 fork_parent..execution_context] +[indexterm2 fork_child..execution_context] + +[heading Values] +[variablelist + + [ + [fork_prepare] + [Notify the context that the process is about to fork. ] + ] + + [ + [fork_parent] + [Notify the context that the process has forked and is the parent. ] + ] + + [ + [fork_child] + [Notify the context that the process has forked and is the child. ] + ] + +] + + + +[endsect] + + + +[section:has_service execution_context::has_service] + +[indexterm2 has_service..execution_context] +Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend bool has_service( + execution_context & e); + + +This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. + + + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:notify_fork execution_context::notify_fork] + +[indexterm2 notify_fork..execution_context] +Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. + + + void notify_fork( + fork_event event); + + +This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `execution_context`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. + +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the execution\_context's derived class, is being called in another thread. It is, however, safe to call this function from within a completion handler, provided no other thread is accessing the [link asio.reference.execution_context `execution_context`] or its derived class. + + +[heading Parameters] + + +[variablelist + +[[event][A fork-related event.]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] + +] + + +[heading Example] + +The following code illustrates how to incorporate the `notify_fork()` function: + + my_execution_context.notify_fork(execution_context::fork_prepare); + if (fork() == 0) + { + // This is the child process. + my_execution_context.notify_fork(execution_context::fork_child); + } + else + { + // This is the parent process. + my_execution_context.notify_fork(execution_context::fork_parent); + } + + + + + +[heading Remarks] + +For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, performs `svc->fork_service();`. When processing the fork\_prepare event, services are visited in reverse order of the beginning of service object lifetime. Otherwise, services are visited in order of the beginning of service object lifetime. + + + + +[endsect] + + + +[section:shutdown_context execution_context::shutdown_context] + +[indexterm2 shutdown_context..execution_context] +Shuts down all services in the context. + + + void shutdown_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. + + + + +[endsect] + + +[section:use_service execution_context::use_service] + +[indexterm2 use_service..execution_context] +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.execution_context.use_service.overload1 use_service]``( + execution_context & e); + `` [''''»''' [link asio.reference.execution_context.use_service.overload1 more...]]`` + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.execution_context.use_service.overload2 use_service]``( + io_service & i); + `` [''''»''' [link asio.reference.execution_context.use_service.overload2 more...]]`` + + +[section:overload1 execution_context::use_service (1 of 2 overloads)] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + execution_context & e); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.execution_context `execution_context`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 execution_context::use_service (2 of 2 overloads)] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + io_service & i); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.io_service `io_service`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[i][The [link asio.reference.io_service `io_service`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + +[heading Remarks] + +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. + + + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[endsect] + + +[section:_execution_context execution_context::~execution_context] + +[indexterm2 ~execution_context..execution_context] +Destructor. + + + ~execution_context(); + + + +[endsect] + + + +[endsect] + +[section:execution_context__id execution_context::id] + + +Class used to uniquely identify a service. + + + class id : + noncopyable + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context__id.id [*id]]] + [Constructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:id execution_context::id::id] + +[indexterm2 id..execution_context::id] +Constructor. + + + id(); + + + +[endsect] + + + +[endsect] + +[section:execution_context__service execution_context::service] + + +Base class for all [link asio.reference.io_service `io_service`] services. + + + class service : + noncopyable + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context__service.context [*context]]] + [Get the context object that owns the service. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context__service.service [*service]]] + [Constructor. ] + ] + + [ + [[link asio.reference.execution_context__service._service [*~service]]] + [Destructor. ] + ] + +] + +[heading Private Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.execution_context__service.fork_service [*fork_service]]] + [Handle notification of a fork-related event to perform any necessary housekeeping. ] + ] + + [ + [[link asio.reference.execution_context__service.shutdown_service [*shutdown_service]]] + [Destroy all user-defined handler objects owned by the service. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:context execution_context::service::context] + +[indexterm2 context..execution_context::service] +Get the context object that owns the service. + + + execution_context & context(); + + + +[endsect] + + + +[section:service execution_context::service::service] + +[indexterm2 service..execution_context::service] +Constructor. + + + service( + execution_context & owner); + + + +[heading Parameters] + + +[variablelist + +[[owner][The [link asio.reference.execution_context `execution_context`] object that owns the service. ]] + +] + + + + +[endsect] + + + +[section:_service execution_context::service::~service] + +[indexterm2 ~service..execution_context::service] +Destructor. + + + virtual ~service(); + + + +[endsect] + + + +[section:fork_service execution_context::service::fork_service] + +[indexterm2 fork_service..execution_context::service] +Handle notification of a fork-related event to perform any necessary housekeeping. + + + virtual void fork_service( + execution_context::fork_event event); + + +This function is not a pure virtual so that services only have to implement it if necessary. The default implementation does nothing. + + +[endsect] + + + +[section:shutdown_service execution_context::service::shutdown_service] + +[indexterm2 shutdown_service..execution_context::service] +Destroy all user-defined handler objects owned by the service. + + + void shutdown_service(); + + + +[endsect] + + + +[endsect] + +[section:executor executor] + + +Polymorphic wrapper for executors. + + + class executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.executor__unspecified_bool_type_t [*unspecified_bool_type_t]]] + [] + + ] + + [ + + [[link asio.reference.executor.unspecified_bool_type [*unspecified_bool_type]]] + [] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.executor.defer [*defer]]] + [Request the executor to invoke the given function object. ] + ] + + [ + [[link asio.reference.executor.dispatch [*dispatch]]] + [Request the executor to invoke the given function object. ] + ] + + [ + [[link asio.reference.executor.executor [*executor]]] + [Default constructor. + + Construct from nullptr. + + Copy constructor. + + Move constructor. + + Construct a polymorphic wrapper for the specified executor. + + Allocator-aware constructor to create a polymorphic wrapper for the specified executor. ] + ] + + [ + [[link asio.reference.executor.on_work_finished [*on_work_finished]]] + [Inform the executor that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.executor.on_work_started [*on_work_started]]] + [Inform the executor that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.executor.operator_unspecified_bool_type [*operator unspecified_bool_type]]] + [Operator to test if the executor contains a valid target. ] + ] + + [ + [[link asio.reference.executor.operator_eq_ [*operator=]]] + [Assignment operator. + + + + Assignment operator for nullptr_t. + + Assignment operator to create a polymorphic wrapper for the specified executor. ] + ] + + [ + [[link asio.reference.executor.post [*post]]] + [Request the executor to invoke the given function object. ] + ] + + [ + [[link asio.reference.executor.target [*target]]] + [Obtain a pointer to the target executor object. ] + ] + + [ + [[link asio.reference.executor.target_type [*target_type]]] + [Obtain type information for the target executor object. ] + ] + + [ + [[link asio.reference.executor.unspecified_bool_true [*unspecified_bool_true]]] + [] + ] + + [ + [[link asio.reference.executor._executor [*~executor]]] + [Destructor. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.executor.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:context executor::context] + +[indexterm2 context..executor] +Obtain the underlying execution context. + + + execution_context & context(); + + + +[endsect] + + + +[section:defer executor::defer] + +[indexterm2 defer..executor] +Request the executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch executor::dispatch] + +[indexterm2 dispatch..executor] +Request the executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + +[section:executor executor::executor] + +[indexterm2 executor..executor] +Default constructor. + + + ``[link asio.reference.executor.executor.overload1 executor]``(); + `` [''''»''' [link asio.reference.executor.executor.overload1 more...]]`` + + +Construct from nullptr. + + + ``[link asio.reference.executor.executor.overload2 executor]``( + nullptr_t ); + `` [''''»''' [link asio.reference.executor.executor.overload2 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.executor.executor.overload3 executor]``( + const executor & other); + `` [''''»''' [link asio.reference.executor.executor.overload3 more...]]`` + + +Move constructor. + + + ``[link asio.reference.executor.executor.overload4 executor]``( + executor && other); + `` [''''»''' [link asio.reference.executor.executor.overload4 more...]]`` + + +Construct a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``> + ``[link asio.reference.executor.executor.overload5 executor]``( + Executor e); + `` [''''»''' [link asio.reference.executor.executor.overload5 more...]]`` + + +Allocator-aware constructor to create a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename Allocator> + ``[link asio.reference.executor.executor.overload6 executor]``( + allocator_arg_t , + const Allocator & a, + Executor e); + `` [''''»''' [link asio.reference.executor.executor.overload6 more...]]`` + + +[section:overload1 executor::executor (1 of 6 overloads)] + + +Default constructor. + + + executor(); + + + +[endsect] + + + +[section:overload2 executor::executor (2 of 6 overloads)] + + +Construct from nullptr. + + + executor( + nullptr_t ); + + + +[endsect] + + + +[section:overload3 executor::executor (3 of 6 overloads)] + + +Copy constructor. + + + executor( + const executor & other); + + + +[endsect] + + + +[section:overload4 executor::executor (4 of 6 overloads)] + + +Move constructor. + + + executor( + executor && other); + + + +[endsect] + + + +[section:overload5 executor::executor (5 of 6 overloads)] + + +Construct a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``> + executor( + Executor e); + + + +[endsect] + + + +[section:overload6 executor::executor (6 of 6 overloads)] + + +Allocator-aware constructor to create a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename Allocator> + executor( + allocator_arg_t , + const Allocator & a, + Executor e); + + + +[endsect] + + +[endsect] + + +[section:on_work_finished executor::on_work_finished] + +[indexterm2 on_work_finished..executor] +Inform the executor that some work is no longer outstanding. + + + void on_work_finished(); + + + +[endsect] + + + +[section:on_work_started executor::on_work_started] + +[indexterm2 on_work_started..executor] +Inform the executor that it has some outstanding work to do. + + + void on_work_started(); + + + +[endsect] + + + +[section:operator_unspecified_bool_type executor::operator unspecified_bool_type] + +[indexterm2 operator unspecified_bool_type..executor] +Operator to test if the executor contains a valid target. + + + operator unspecified_bool_type() const; + + + +[endsect] + + + +[section:operator_not__eq_ executor::operator!=] + +[indexterm2 operator!=..executor] +Compare two executors for inequality. + + + friend bool operator!=( + const executor & a, + const executor & b); + + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:operator_eq_ executor::operator=] + +[indexterm2 operator=..executor] +Assignment operator. + + + executor & ``[link asio.reference.executor.operator_eq_.overload1 operator=]``( + const executor & other); + `` [''''»''' [link asio.reference.executor.operator_eq_.overload1 more...]]`` + + + + executor & ``[link asio.reference.executor.operator_eq_.overload2 operator=]``( + executor && other); + `` [''''»''' [link asio.reference.executor.operator_eq_.overload2 more...]]`` + + +Assignment operator for nullptr\_t. + + + executor & ``[link asio.reference.executor.operator_eq_.overload3 operator=]``( + nullptr_t ); + `` [''''»''' [link asio.reference.executor.operator_eq_.overload3 more...]]`` + + +Assignment operator to create a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``> + executor & ``[link asio.reference.executor.operator_eq_.overload4 operator=]``( + Executor e); + `` [''''»''' [link asio.reference.executor.operator_eq_.overload4 more...]]`` + + +[section:overload1 executor::operator= (1 of 4 overloads)] + + +Assignment operator. + + + executor & operator=( + const executor & other); + + + +[endsect] + + + +[section:overload2 executor::operator= (2 of 4 overloads)] + + + + executor & operator=( + executor && other); + + + +[endsect] + + + +[section:overload3 executor::operator= (3 of 4 overloads)] + + +Assignment operator for nullptr\_t. + + + executor & operator=( + nullptr_t ); + + + +[endsect] + + + +[section:overload4 executor::operator= (4 of 4 overloads)] + + +Assignment operator to create a polymorphic wrapper for the specified executor. + + + template< + typename ``[link asio.reference.Executor Executor]``> + executor & operator=( + Executor e); + + + +[endsect] + + +[endsect] + + +[section:operator_eq__eq_ executor::operator==] + +[indexterm2 operator==..executor] +Compare two executors for equality. + + + friend bool operator==( + const executor & a, + const executor & b); + + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:post executor::post] + +[indexterm2 post..executor] +Request the executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object is executed according to the rules of the target executor object. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + +[section:target executor::target] + +[indexterm2 target..executor] +Obtain a pointer to the target executor object. + + + template< + typename ``[link asio.reference.Executor Executor]``> + Executor * ``[link asio.reference.executor.target.overload1 target]``(); + `` [''''»''' [link asio.reference.executor.target.overload1 more...]]`` + + template< + typename ``[link asio.reference.Executor Executor]``> + const Executor * ``[link asio.reference.executor.target.overload2 target]``() const; + `` [''''»''' [link asio.reference.executor.target.overload2 more...]]`` + + +[section:overload1 executor::target (1 of 2 overloads)] + + +Obtain a pointer to the target executor object. + + + template< + typename ``[link asio.reference.Executor Executor]``> + Executor * target(); + + + +[heading Return Value] + +If `target_type() == typeid(T)`, a pointer to the stored executor target; otherwise, a null pointer. + + + + +[endsect] + + + +[section:overload2 executor::target (2 of 2 overloads)] + + +Obtain a pointer to the target executor object. + + + template< + typename ``[link asio.reference.Executor Executor]``> + const Executor * target() const; + + + +[heading Return Value] + +If `target_type() == typeid(T)`, a pointer to the stored executor target; otherwise, a null pointer. + + + + +[endsect] + + +[endsect] + + +[section:target_type executor::target_type] + +[indexterm2 target_type..executor] +Obtain type information for the target executor object. + + + const std::type_info & target_type() const; + + + +[heading Return Value] + +If `*this` has a target type of type `T`, `typeid(T)`; otherwise, `typeid(void)`. + + + + +[endsect] + + + +[section:unspecified_bool_true executor::unspecified_bool_true] + +[indexterm2 unspecified_bool_true..executor] + + static void unspecified_bool_true( + unspecified_bool_type_t ); + + + +[endsect] + + + +[section:unspecified_bool_type executor::unspecified_bool_type] + +[indexterm2 unspecified_bool_type..executor] + + typedef void(*) unspecified_bool_type; + + + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:_executor executor::~executor] + +[indexterm2 ~executor..executor] +Destructor. + + + ~executor(); + + + +[endsect] + + + +[endsect] + +[section:executor__unspecified_bool_type_t executor::unspecified_bool_type_t] + + + + struct unspecified_bool_type_t + + +[heading Requirements] + +['Header: ][^asio/executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:executor_arg executor_arg] + +[indexterm1 executor_arg] +A special value, similar to std::nothrow, used to disambiguate constructors that accept executor arguments. + + + constexpr executor_arg_t executor_arg; + + +See [link asio.reference.executor_arg_t `executor_arg_t`] and [link asio.reference.uses_executor `uses_executor`] for more information. + +[heading Requirements] + +['Header: ][^asio/uses_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:executor_arg_t executor_arg_t] + + +A special type, similar to std::nothrow\_t, used to disambiguate constructors that accept executor arguments. + + + struct executor_arg_t + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor_arg_t.executor_arg_t [*executor_arg_t]]] + [Constructor. ] + ] + +] + +The [link asio.reference.executor_arg_t `executor_arg_t`] struct is an empty structure type used as a unique type to disambiguate constructor and function overloading. Specifically, some types have constructors with [link asio.reference.executor_arg_t `executor_arg_t`] as the first argument, immediately followed by an argument of a type that satisfies the Executor type requirements. + +[heading Requirements] + +['Header: ][^asio/uses_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:executor_arg_t executor_arg_t::executor_arg_t] + +[indexterm2 executor_arg_t..executor_arg_t] +Constructor. + + + constexpr executor_arg_t(); + + + +[endsect] + + + +[endsect] + +[section:executor_work executor_work] + + +An object of type `executor_work` controls ownership of executor work within a scope. + + + template< + typename ``[link asio.reference.Executor Executor]``> + class executor_work + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.executor_work.executor_type [*executor_type]]] + [The underlying executor type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor_work.executor_work [*executor_work]]] + [Constructs a executor_work object for the specified executor. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.executor_work.get_executor [*get_executor]]] + [Obtain the associated executor. ] + ] + + [ + [[link asio.reference.executor_work.owns_work [*owns_work]]] + [Whether the executor_work object owns some outstanding work. ] + ] + + [ + [[link asio.reference.executor_work.reset [*reset]]] + [Indicate that the work is no longer outstanding. ] + ] + + [ + [[link asio.reference.executor_work._executor_work [*~executor_work]]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/executor_work.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:executor_type executor_work::executor_type] + +[indexterm2 executor_type..executor_work] +The underlying executor type. + + + typedef Executor executor_type; + + + +[heading Requirements] + +['Header: ][^asio/executor_work.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:executor_work executor_work::executor_work] + +[indexterm2 executor_work..executor_work] +Constructs a `executor_work` object for the specified executor. + + + explicit ``[link asio.reference.executor_work.executor_work.overload1 executor_work]``( + const executor_type & e); + `` [''''»''' [link asio.reference.executor_work.executor_work.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.executor_work.executor_work.overload2 executor_work]``( + const executor_work & other); + `` [''''»''' [link asio.reference.executor_work.executor_work.overload2 more...]]`` + + +Move constructor. + + + ``[link asio.reference.executor_work.executor_work.overload3 executor_work]``( + executor_work && other); + `` [''''»''' [link asio.reference.executor_work.executor_work.overload3 more...]]`` + + +[section:overload1 executor_work::executor_work (1 of 3 overloads)] + + +Constructs a `executor_work` object for the specified executor. + + + executor_work( + const executor_type & e); + + +Stores a copy of `e` and calls `on_work_started()` on it. + + +[endsect] + + + +[section:overload2 executor_work::executor_work (2 of 3 overloads)] + + +Copy constructor. + + + executor_work( + const executor_work & other); + + + +[endsect] + + + +[section:overload3 executor_work::executor_work (3 of 3 overloads)] + + +Move constructor. + + + executor_work( + executor_work && other); + + + +[endsect] + + +[endsect] + + +[section:get_executor executor_work::get_executor] + +[indexterm2 get_executor..executor_work] +Obtain the associated executor. + + + executor_type get_executor() const; + + + +[endsect] + + + +[section:owns_work executor_work::owns_work] + +[indexterm2 owns_work..executor_work] +Whether the [link asio.reference.executor_work `executor_work`] object owns some outstanding work. + + + bool owns_work() const; + + + +[endsect] + + + +[section:reset executor_work::reset] + +[indexterm2 reset..executor_work] +Indicate that the work is no longer outstanding. + + + void reset(); + + + +[endsect] + + + +[section:_executor_work executor_work::~executor_work] + +[indexterm2 ~executor_work..executor_work] +Destructor. + + + ~executor_work(); + + +Unless the object has already been reset, or is in a moved-from state, calls `on_work_finished()` on the stored executor. + + +[endsect] + + + +[endsect] + +[section:executor_wrapper executor_wrapper] + + +A call wrapper type to associate an object of type `T` with an executor of type `Executor`. + + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + class executor_wrapper + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.executor_wrapper.argument_type [*argument_type]]] + [The type of the function's argument. ] + + ] + + [ + + [[link asio.reference.executor_wrapper.executor_type [*executor_type]]] + [The type of the associated executor. ] + + ] + + [ + + [[link asio.reference.executor_wrapper.first_argument_type [*first_argument_type]]] + [The type of the function's first argument. ] + + ] + + [ + + [[link asio.reference.executor_wrapper.result_type [*result_type]]] + [The return type if a function. ] + + ] + + [ + + [[link asio.reference.executor_wrapper.second_argument_type [*second_argument_type]]] + [The type of the function's second argument. ] + + ] + + [ + + [[link asio.reference.executor_wrapper.wrapped_type [*wrapped_type]]] + [The type of the wrapped object. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor_wrapper.executor_wrapper [*executor_wrapper]]] + [Construct an executor wrapper for the specified object. + + Copy constructor. + + Construct a copy, but specify a different executor. + + Construct a copy of a different executor wrapper type. + + Construct a copy of a different executor wrapper type, but specify a different executor. + + Move constructor. + + Move construct the wrapped object, but specify a different executor. + + Move construct from a different executor wrapper type. + + Move construct from a different executor wrapper type, but specify a different executor. ] + ] + + [ + [[link asio.reference.executor_wrapper.get_executor [*get_executor]]] + [Obtain the associated executor. ] + ] + + [ + [[link asio.reference.executor_wrapper.operator_lp__rp_ [*operator()]]] + [] + ] + + [ + [[link asio.reference.executor_wrapper.unwrap [*unwrap]]] + [Obtain a reference to the wrapped object. ] + ] + + [ + [[link asio.reference.executor_wrapper._executor_wrapper [*~executor_wrapper]]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:argument_type executor_wrapper::argument_type] + +[indexterm2 argument_type..executor_wrapper] +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: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:executor_type executor_wrapper::executor_type] + +[indexterm2 executor_type..executor_wrapper] +The type of the associated executor. + + + typedef Executor executor_type; + + + +[heading Requirements] + +['Header: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:executor_wrapper executor_wrapper::executor_wrapper] + +[indexterm2 executor_wrapper..executor_wrapper] +Construct an executor wrapper for the specified object. + + + template< + typename U> + ``[link asio.reference.executor_wrapper.executor_wrapper.overload1 executor_wrapper]``( + executor_arg_t , + const executor_type & e, + U u); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.executor_wrapper.executor_wrapper.overload2 executor_wrapper]``( + const executor_wrapper & other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload2 more...]]`` + + +Construct a copy, but specify a different executor. + + + ``[link asio.reference.executor_wrapper.executor_wrapper.overload3 executor_wrapper]``( + executor_arg_t , + const executor_type & e, + const executor_wrapper & other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload3 more...]]`` + + +Construct a copy of a different executor wrapper type. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.executor_wrapper.executor_wrapper.overload4 executor_wrapper]``( + const executor_wrapper< U, OtherExecutor > & other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload4 more...]]`` + + +Construct a copy of a different executor wrapper type, but specify a different executor. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.executor_wrapper.executor_wrapper.overload5 executor_wrapper]``( + executor_arg_t , + const executor_type & e, + const executor_wrapper< U, OtherExecutor > & other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload5 more...]]`` + + +Move constructor. + + + ``[link asio.reference.executor_wrapper.executor_wrapper.overload6 executor_wrapper]``( + executor_wrapper && other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload6 more...]]`` + + +Move construct the wrapped object, but specify a different executor. + + + ``[link asio.reference.executor_wrapper.executor_wrapper.overload7 executor_wrapper]``( + executor_arg_t , + const executor_type & e, + executor_wrapper && other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload7 more...]]`` + + +Move construct from a different executor wrapper type. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.executor_wrapper.executor_wrapper.overload8 executor_wrapper]``( + executor_wrapper< U, OtherExecutor > && other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload8 more...]]`` + + +Move construct from a different executor wrapper type, but specify a different executor. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.executor_wrapper.executor_wrapper.overload9 executor_wrapper]``( + executor_arg_t , + const executor_type & e, + executor_wrapper< U, OtherExecutor > && other); + `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload9 more...]]`` + + +[section:overload1 executor_wrapper::executor_wrapper (1 of 9 overloads)] + + +Construct an executor wrapper for the specified object. + + + template< + typename U> + executor_wrapper( + executor_arg_t , + const executor_type & e, + U u); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload2 executor_wrapper::executor_wrapper (2 of 9 overloads)] + + +Copy constructor. + + + executor_wrapper( + const executor_wrapper & other); + + + +[endsect] + + + +[section:overload3 executor_wrapper::executor_wrapper (3 of 9 overloads)] + + +Construct a copy, but specify a different executor. + + + executor_wrapper( + executor_arg_t , + const executor_type & e, + const executor_wrapper & other); + + + +[endsect] + + + +[section:overload4 executor_wrapper::executor_wrapper (4 of 9 overloads)] + + +Construct a copy of a different executor wrapper type. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + executor_wrapper( + const executor_wrapper< 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 executor_wrapper::executor_wrapper (5 of 9 overloads)] + + +Construct a copy of a different executor wrapper type, but specify a different executor. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + executor_wrapper( + executor_arg_t , + const executor_type & e, + const executor_wrapper< U, OtherExecutor > & other); + + +This constructor is only valid if the type `T` is constructible from type `U`. + + +[endsect] + + + +[section:overload6 executor_wrapper::executor_wrapper (6 of 9 overloads)] + + +Move constructor. + + + executor_wrapper( + executor_wrapper && other); + + + +[endsect] + + + +[section:overload7 executor_wrapper::executor_wrapper (7 of 9 overloads)] + + +Move construct the wrapped object, but specify a different executor. + + + executor_wrapper( + executor_arg_t , + const executor_type & e, + executor_wrapper && other); + + + +[endsect] + + + +[section:overload8 executor_wrapper::executor_wrapper (8 of 9 overloads)] + + +Move construct from a different executor wrapper type. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + executor_wrapper( + executor_wrapper< U, OtherExecutor > && other); + + + +[endsect] + + + +[section:overload9 executor_wrapper::executor_wrapper (9 of 9 overloads)] + + +Move construct from a different executor wrapper type, but specify a different executor. + + + template< + typename U, + typename ``[link asio.reference.Executor OtherExecutor]``> + executor_wrapper( + executor_arg_t , + const executor_type & e, + executor_wrapper< U, OtherExecutor > && other); + + + +[endsect] + + +[endsect] + + +[section:first_argument_type executor_wrapper::first_argument_type] + +[indexterm2 first_argument_type..executor_wrapper] +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: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor executor_wrapper::get_executor] + +[indexterm2 get_executor..executor_wrapper] +Obtain the associated executor. + + + executor_type get_executor() const; + + + +[endsect] + + +[section:operator_lp__rp_ executor_wrapper::operator()] + +[indexterm2 operator()..executor_wrapper] + + template< + typename... Args> + auto ``[link asio.reference.executor_wrapper.operator_lp__rp_.overload1 operator()]``( + Args && ...); + `` [''''»''' [link asio.reference.executor_wrapper.operator_lp__rp_.overload1 more...]]`` + + template< + typename... Args> + auto ``[link asio.reference.executor_wrapper.operator_lp__rp_.overload2 operator()]``( + Args && ...) const; + `` [''''»''' [link asio.reference.executor_wrapper.operator_lp__rp_.overload2 more...]]`` + + +[section:overload1 executor_wrapper::operator() (1 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...); + + + +[endsect] + + + +[section:overload2 executor_wrapper::operator() (2 of 2 overloads)] + + + + template< + typename... Args> + auto operator()( + Args && ...) const; + + + +[endsect] + + +[endsect] + + +[section:result_type executor_wrapper::result_type] + +[indexterm2 result_type..executor_wrapper] +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: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:second_argument_type executor_wrapper::second_argument_type] + +[indexterm2 second_argument_type..executor_wrapper] +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: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:unwrap executor_wrapper::unwrap] + +[indexterm2 unwrap..executor_wrapper] +Obtain a reference to the wrapped object. + + + wrapped_type & ``[link asio.reference.executor_wrapper.unwrap.overload1 unwrap]``(); + `` [''''»''' [link asio.reference.executor_wrapper.unwrap.overload1 more...]]`` + + const wrapped_type & ``[link asio.reference.executor_wrapper.unwrap.overload2 unwrap]``() const; + `` [''''»''' [link asio.reference.executor_wrapper.unwrap.overload2 more...]]`` + + +[section:overload1 executor_wrapper::unwrap (1 of 2 overloads)] + + +Obtain a reference to the wrapped object. + + + wrapped_type & unwrap(); + + + +[endsect] + + + +[section:overload2 executor_wrapper::unwrap (2 of 2 overloads)] + + +Obtain a reference to the wrapped object. + + + const wrapped_type & unwrap() const; + + + +[endsect] + + +[endsect] + + +[section:wrapped_type executor_wrapper::wrapped_type] + +[indexterm2 wrapped_type..executor_wrapper] +The type of the wrapped object. + + + typedef T wrapped_type; + + + +[heading Requirements] + +['Header: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:_executor_wrapper executor_wrapper::~executor_wrapper] + +[indexterm2 ~executor_wrapper..executor_wrapper] +Destructor. + + + ~executor_wrapper(); + + + +[endsect] + + + +[endsect] + [section:generic__basic_endpoint generic::basic_endpoint] @@ -56943,6 +62027,13 @@ [ + [[link asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -56985,20 +62076,6 @@ [ - [[link asio.reference.basic_datagram_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -57053,6 +62130,13 @@ ] + [ + + [[link asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -57090,6 +62174,11 @@ ] [ + [[link 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 asio.reference.basic_datagram_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -57135,8 +62224,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -57167,11 +62261,6 @@ ] [ - [[link asio.reference.basic_datagram_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_datagram_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -57237,6 +62326,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -57286,22 +62380,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_datagram_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_datagram_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. @@ -57786,6 +62864,13 @@ [ + [[link asio.reference.basic_raw_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_raw_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -57828,20 +62913,6 @@ [ - [[link asio.reference.basic_raw_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_raw_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -57896,6 +62967,13 @@ ] + [ + + [[link asio.reference.basic_raw_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -57933,6 +63011,11 @@ ] [ + [[link asio.reference.basic_raw_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 asio.reference.basic_raw_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -57978,8 +63061,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -58010,11 +63098,6 @@ ] [ - [[link asio.reference.basic_raw_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_raw_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -58080,6 +63163,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_raw_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -58129,22 +63217,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_raw_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_raw_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_raw_socket `basic_raw_socket`] class template provides asynchronous and blocking raw-oriented socket functionality. @@ -58624,6 +63696,13 @@ [ + [[link asio.reference.basic_seq_packet_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_seq_packet_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -58666,20 +63745,6 @@ [ - [[link asio.reference.basic_seq_packet_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_seq_packet_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_seq_packet_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -58734,6 +63799,13 @@ ] + [ + + [[link asio.reference.basic_seq_packet_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -58761,6 +63833,11 @@ ] [ + [[link 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 asio.reference.basic_seq_packet_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -58806,8 +63883,13 @@ ] [ + [[link asio.reference.basic_seq_packet_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_seq_packet_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -58838,11 +63920,6 @@ ] [ - [[link asio.reference.basic_seq_packet_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_seq_packet_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -58900,6 +63977,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -58949,22 +64031,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_seq_packet_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_seq_packet_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] class template provides asynchronous and blocking sequenced packet socket functionality. @@ -59288,13 +64354,20 @@ [ - [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [[link asio.reference.basic_socket_iostream.duration [*duration]]] [The duration type. ] ] [ + [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [(Deprecated: Use duration.) The duration type. ] + + ] + + [ + [[link asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]] [The endpoint type. ] @@ -59302,11 +64375,18 @@ [ - [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [[link asio.reference.basic_socket_iostream.time_point [*time_point]]] [The time type. ] ] + [ + + [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [(Deprecated: Use time_point.) The time type. ] + + ] + ] [heading Member Functions] @@ -59336,17 +64416,27 @@ ] [ + [[link asio.reference.basic_socket_iostream.expires_after [*expires_after]]] + [Set the stream's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_socket_iostream.expires_at [*expires_at]]] - [Get the stream's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the stream's expiry time as an absolute time. Set the stream's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the stream's expiry time relative to now. - Set the stream's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the stream's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_socket_iostream.expiry [*expiry]]] + [Get the stream's expiry time as an absolute time. ] ] [ @@ -59483,6 +64573,13 @@ [ + [[link asio.reference.basic_stream_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_stream_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -59525,20 +64622,6 @@ [ - [[link asio.reference.basic_stream_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_stream_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -59593,6 +64676,13 @@ ] + [ + + [[link asio.reference.basic_stream_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -59625,6 +64715,11 @@ ] [ + [[link asio.reference.basic_stream_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 asio.reference.basic_stream_socket.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -59675,8 +64770,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -59707,11 +64807,6 @@ ] [ - [[link asio.reference.basic_stream_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_stream_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -59775,6 +64870,11 @@ ] [ + [[link asio.reference.basic_stream_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_stream_socket.write_some [*write_some]]] [Write some data to the socket. ] ] @@ -59828,22 +64928,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_stream_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_stream_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality. @@ -59952,15 +65036,210 @@ [endsect] -[section:handler_type handler_type] +[section:get_associated_allocator get_associated_allocator] + +[indexterm1 get_associated_allocator] +Helper function to obtain an object's associated allocator. + + + template< + typename T> + associated_allocator< T >::type ``[link asio.reference.get_associated_allocator.overload1 get_associated_allocator]``( + const T & t); + `` [''''»''' [link asio.reference.get_associated_allocator.overload1 more...]]`` + + template< + typename T, + typename Allocator> + associated_allocator< T, Allocator >::type ``[link asio.reference.get_associated_allocator.overload2 get_associated_allocator]``( + const T & t, + const Allocator & a); + `` [''''»''' [link asio.reference.get_associated_allocator.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^asio/associated_allocator.hpp] + +['Convenience header: ][^asio.hpp] -Default handler type traits provided for all handlers. +[section:overload1 get_associated_allocator (1 of 2 overloads)] + + +Helper function to obtain an object's associated allocator. template< - typename ``[link asio.reference.Handler Handler]``, - typename Signature> + typename T> + associated_allocator< T >::type get_associated_allocator( + const T & t); + + + +[heading Return Value] + +`associated_allocator<T>::get(t)` + + + + +[endsect] + + + +[section:overload2 get_associated_allocator (2 of 2 overloads)] + + +Helper function to obtain an object's associated allocator. + + + template< + typename T, + typename Allocator> + associated_allocator< T, Allocator >::type get_associated_allocator( + const T & t, + const Allocator & a); + + + +[heading Return Value] + +`associated_allocator<T, Allocator>::get(t, a)` + + + + +[endsect] + + +[endsect] + +[section:get_associated_executor get_associated_executor] + +[indexterm1 get_associated_executor] +Helper function to obtain an object's associated executor. + + + template< + typename T> + associated_executor< T >::type ``[link asio.reference.get_associated_executor.overload1 get_associated_executor]``( + const T & t); + `` [''''»''' [link asio.reference.get_associated_executor.overload1 more...]]`` + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + associated_executor< T, Executor >::type ``[link asio.reference.get_associated_executor.overload2 get_associated_executor]``( + const T & t, + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.get_associated_executor.overload2 more...]]`` + + template< + typename T, + typename ExecutionContext> + associated_executor< T, typename ExecutionContext::executor_type >::type ``[link asio.reference.get_associated_executor.overload3 get_associated_executor]``( + const T & t, + ExecutionContext & ctx, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.get_associated_executor.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^asio/associated_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 get_associated_executor (1 of 3 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T> + associated_executor< T >::type get_associated_executor( + const T & t); + + + +[heading Return Value] + +`associated_executor<T>::get(t)` + + + + +[endsect] + + + +[section:overload2 get_associated_executor (2 of 3 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + associated_executor< T, Executor >::type get_associated_executor( + const T & t, + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + + + +[heading Return Value] + +`associated_executor<T, Executor>::get(t, ex)` + + + + +[endsect] + + + +[section:overload3 get_associated_executor (3 of 3 overloads)] + + +Helper function to obtain an object's associated executor. + + + template< + typename T, + typename ExecutionContext> + associated_executor< T, typename ExecutionContext::executor_type >::type get_associated_executor( + const T & t, + ExecutionContext & ctx, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[heading Return Value] + +`associated_executor<T, typename ExecutionContext::executor_type>get(t, ctx.get_executor())` + + + + +[endsect] + + +[endsect] + +[section:handler_type handler_type] + + +Default handler type traits provided for all completion token types. + + + template< + typename CompletionToken, + typename Signature, + typename = void> struct handler_type @@ -59979,7 +65258,7 @@ The [link asio.reference.handler_type `handler_type`] traits class is used for determining the concrete handler type to be used for an asynchronous operation. It allows the handler type to be determined at the point where the specific completion handler signature is known. -This template may be specialised for user-defined handler types. +This template may be specialised for user-defined completion token types. [heading Requirements] @@ -59994,7 +65273,7 @@ The handler type for the specific signature. - typedef Handler type; + typedef conditional< is_same< CompletionToken, typename decay< CompletionToken >::type >::value, decay< CompletionToken >, handler_type< typename decay< CompletionToken >::type, Signature > >::type::type type; @@ -60019,10 +65298,10 @@ template< typename ``[link asio.reference.Service Service]``> bool has_service( - io_service & ios); + execution_context & e); -This function is used to determine whether the [link asio.reference.io_service `io_service`] contains a service object corresponding to the given service type. +This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. [heading Parameters] @@ -60030,20 +65309,20 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] ] [heading Return Value] -A boolean indicating whether the [link asio.reference.io_service `io_service`] contains the service. +A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/impl/execution_context.hpp] ['Convenience header: ][^asio.hpp] @@ -60081,6 +65360,13 @@ [ + [[link asio.reference.basic_waitable_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_waitable_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -60124,7 +65410,9 @@ Constructor to set a particular expiry time as an absolute time. - Constructor to set a particular expiry time relative to now. ] + Constructor to set a particular expiry time relative to now. + + Move-construct a basic_waitable_timer from another. ] ] [ @@ -60138,22 +65426,42 @@ ] [ + [[link asio.reference.basic_waitable_timer.expires_after [*expires_after]]] + [Set the timer's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_waitable_timer.expires_at [*expires_at]]] - [Get the timer's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the timer's expiry time as an absolute time. Set the timer's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_waitable_timer.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the timer's expiry time relative to now. - Set the timer's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the timer's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.expiry [*expiry]]] + [Get the timer's expiry time as an absolute time. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] ] [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.operator_eq_ [*operator=]]] + [Move-assign a basic_waitable_timer from another. ] ] [ @@ -60179,22 +65487,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_waitable_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_waitable_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_waitable_timer `basic_waitable_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A waitable timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -60222,7 +65514,7 @@ asio::steady_timer timer(io_service); // Set an expiry time relative to now. - timer.expires_from_now(std::chrono::seconds(5)); + timer.expires_after(std::chrono::seconds(5)); // Wait for the timer to expire. timer.wait(); @@ -60264,7 +65556,7 @@ void on_some_event() { - if (my_timer.expires_from_now(seconds(5)) > 0) + if (my_timer.expires_after(seconds(5)) > 0) { // We managed to cancel the timer. Start new asynchronous wait. my_timer.async_wait(on_timeout); @@ -60287,7 +65579,7 @@ -* The `asio::basic_waitable_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. +* The `asio::basic_waitable_timer::expires_after()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. * If a wait handler is cancelled, the [link asio.reference.error_code `error_code`] passed to it contains the value `asio::error::operation_aborted`. @@ -60315,7 +65607,7 @@ [section:invalid_service_owner invalid_service_owner] -Exception thrown when trying to add a service object to an [link asio.reference.io_service `io_service`] where the service has a different owner. +Exception thrown when trying to add a service object to an [link asio.reference.execution_context `execution_context`] where the service has a different owner. class invalid_service_owner @@ -60334,7 +65626,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/execution_context.hpp] ['Convenience header: ][^asio.hpp] @@ -60360,7 +65652,7 @@ class io_service : - noncopyable + public execution_context [heading Types] @@ -60369,8 +65661,8 @@ [ - [[link asio.reference.io_service__id [*id]]] - [Class used to uniquely identify a service. ] + [[link asio.reference.io_service__executor_type [*executor_type]]] + [Executor used to submit functions to an io_service. ] ] @@ -60410,7 +65702,12 @@ [ [[link asio.reference.io_service.dispatch [*dispatch]]] - [Request the io_service to invoke the given handler. ] + [(Deprecated: Use asio::dispatch().) Request the io_service to invoke the given handler. ] + ] + + [ + [[link asio.reference.io_service.get_executor [*get_executor]]] + [Obtains the executor associated with the io_service. ] ] [ @@ -60420,7 +65717,7 @@ [ [[link asio.reference.io_service.notify_fork [*notify_fork]]] - [Notify the io_service of a fork-related event. ] + [Notify the execution_context of a fork-related event. ] ] [ @@ -60435,12 +65732,17 @@ [ [[link asio.reference.io_service.post [*post]]] - [Request the io_service to invoke the given handler and return immediately. ] + [(Deprecated: Use asio::post().) Request the io_service to invoke the given handler and return immediately. ] ] [ [[link asio.reference.io_service.reset [*reset]]] - [Reset the io_service in preparation for a subsequent run() invocation. ] + [(Deprecated: Use restart().) Reset the io_service in preparation for a subsequent run() invocation. ] + ] + + [ + [[link asio.reference.io_service.restart [*restart]]] + [Restart the io_service in preparation for a subsequent run() invocation. ] ] [ @@ -60465,7 +65767,7 @@ [ [[link asio.reference.io_service.wrap [*wrap]]] - [Create a new handler that automatically dispatches the wrapped handler on the io_service. ] + [(Deprecated: Use asio::wrap().) Create a new handler that automatically dispatches the wrapped handler on the io_service. ] ] [ @@ -60475,23 +65777,41 @@ ] +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service.destroy_context [*destroy_context]]] + [Destroys all services in the context. ] + ] + + [ + [[link asio.reference.io_service.shutdown_context [*shutdown_context]]] + [Shuts down all services in the context. ] + ] + +] + [heading Friends] [table [[Name][Description]] [ [[link asio.reference.io_service.add_service [*add_service]]] - [Add a service object to the io_service. ] + [Add a service object to the execution_context. ] ] [ [[link asio.reference.io_service.has_service [*has_service]]] - [Determine if an io_service contains a specified service type. ] + [Determine if an execution_context contains a specified service type. ] ] [ [[link asio.reference.io_service.use_service [*use_service]]] - [Obtain the service object corresponding to the given type. ] + [ + + Obtain the service object corresponding to the given type. ] ] ] @@ -60514,7 +65834,7 @@ ['Distinct] ['objects:] Safe. -['Shared] ['objects:] Safe, with the specific exceptions of the `reset()` and `notify_fork()` functions. Calling `reset()` while there are unfinished `run()`, `run_one()`, `poll()` or `poll_one()` calls results in undefined behaviour. The `notify_fork()` function should not be called while any [link asio.reference.io_service `io_service`] function, or any function on an I/O object that is associated with the [link asio.reference.io_service `io_service`], is being called in another thread. +['Shared] ['objects:] Safe, with the specific exceptions of the `restart()` and `notify_fork()` functions. Calling `restart()` while there are unfinished `run()`, `run_one()`, `poll()` or `poll_one()` calls results in undefined behaviour. The `notify_fork()` function should not be called while any [link asio.reference.io_service `io_service`] function, or any function on an I/O object that is associated with the [link asio.reference.io_service `io_service`], is being called in another thread. @@ -60531,7 +65851,7 @@ If an exception is thrown from a handler, the exception is allowed to propagate through the throwing thread's invocation of `run()`, `run_one()`, `poll()` or `poll_one()`. No other threads that are calling any of these functions are affected. It is then the responsibility of the application to catch the exception. -After the exception has been caught, the `run()`, `run_one()`, `poll()` or `poll_one()` call may be restarted ['without] the need for an intervening call to `reset()`. This allows the thread to rejoin the [link asio.reference.io_service `io_service`] object's thread pool without impacting any other threads in the pool. +After the exception has been caught, the `run()`, `run_one()`, `poll()` or `poll_one()` call may be restarted ['without] the need for an intervening call to `restart()`. This allows the thread to rejoin the [link asio.reference.io_service `io_service`] object's thread pool without impacting any other threads in the pool. For example: @@ -60586,25 +65906,6 @@ - -[heading The io_service class and I/O services] - - - -Class [link asio.reference.io_service `io_service`] implements an extensible, type-safe, polymorphic set of I/O services, indexed by service type. An object of class [link asio.reference.io_service `io_service`] must be initialised before I/O objects such as sockets, resolvers and timers can be used. These I/O objects are distinguished by having constructors that accept an `io_service&` parameter. - -I/O services exist to manage the logical interface to the operating system on behalf of the I/O objects. In particular, there are resources that are shared across a class of I/O objects. For example, timers may be implemented in terms of a single timer queue. The I/O services manage these shared resources. - -Access to the services of an [link asio.reference.io_service `io_service`] is via three function templates, `use_service()`, `add_service()` and `has_service()`. - -In a call to `use_service<Service>()`, the type argument chooses a service, making available all members of the named type. If `Service` is not present in an [link asio.reference.io_service `io_service`], an object of type `Service` is created and added to the [link asio.reference.io_service `io_service`]. A C++ program can check if an [link asio.reference.io_service `io_service`] implements a particular service with the function template `has_service<Service>()`. - -Service objects may be explicitly added to an [link asio.reference.io_service `io_service`] using the function template `add_service<Service>()`. If the `Service` is already present, the [link asio.reference.service_already_exists `service_already_exists`] exception is thrown. If the owner of the service is not the same object as the [link asio.reference.io_service `io_service`] parameter, the [link asio.reference.invalid_service_owner `invalid_service_owner`] exception is thrown. - -Once a service reference is obtained from an [link asio.reference.io_service `io_service`] object by calling `use_service()`, that reference remains usable as long as the owning [link asio.reference.io_service `io_service`] object exists. - -All I/O service implementations have [link asio.reference.io_service__service `io_service::service`] as a public base class. Custom I/O services may be implemented by deriving from this class and then added to an [link asio.reference.io_service `io_service`] using the facilities described above. - [heading Requirements] ['Header: ][^asio/io_service.hpp] @@ -60614,18 +65915,21 @@ [section:add_service io_service::add_service] + +['Inherited from execution_context.] + [indexterm2 add_service..io_service] -Add a service object to the [link asio.reference.io_service `io_service`]. +Add a service object to the [link asio.reference.execution_context `execution_context`]. template< typename ``[link asio.reference.Service Service]``> friend void add_service( - io_service & ios, + execution_context & e, Service * svc); -This function is used to add a service to the [link asio.reference.io_service `io_service`]. +This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. [heading Parameters] @@ -60633,11 +65937,11 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] -[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.io_service `io_service`]. When the [link asio.reference.io_service `io_service`] object is destroyed, it will destroy the service object by performing: +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: `` - delete static_cast<io_service::service*>(svc) + delete static_cast<execution_context::service*>(svc) `` ]] @@ -60649,9 +65953,9 @@ [variablelist -[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.io_service `io_service`].]] +[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] -[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.io_service `io_service`] is not the [link asio.reference.io_service `io_service`] object specified by the ios parameter. ]] +[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] ] @@ -60668,10 +65972,34 @@ +[section:destroy_context io_service::destroy_context] + + +['Inherited from execution_context.] + +[indexterm2 destroy_context..io_service] +Destroys all services in the context. + + + void destroy_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order * of the beginning of service object lifetime, performs `delete static_cast<execution_context::service*>(svc)`. + + + + +[endsect] + + + [section:dispatch io_service::dispatch] [indexterm2 dispatch..io_service] -Request the [link asio.reference.io_service `io_service`] to invoke the given handler. +(Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the [link asio.reference.io_service `io_service`] to invoke the given handler. template< @@ -60718,6 +66046,9 @@ [section:fork_event io_service::fork_event] + +['Inherited from execution_context.] + [indexterm2 fork_event..io_service] Fork-related event notifications. @@ -60733,17 +66064,17 @@ [ [fork_prepare] - [Notify the io_service that the process is about to fork. ] + [Notify the context that the process is about to fork. ] ] [ [fork_parent] - [Notify the io_service that the process has forked and is the parent. ] + [Notify the context that the process has forked and is the parent. ] ] [ [fork_child] - [Notify the io_service that the process has forked and is the child. ] + [Notify the context that the process has forked and is the child. ] ] ] @@ -60754,19 +66085,36 @@ +[section:get_executor io_service::get_executor] + +[indexterm2 get_executor..io_service] +Obtains the executor associated with the [link asio.reference.io_service `io_service`]. + + + executor_type get_executor(); + + + +[endsect] + + + [section:has_service io_service::has_service] + +['Inherited from execution_context.] + [indexterm2 has_service..io_service] -Determine if an [link asio.reference.io_service `io_service`] contains a specified service type. +Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. template< typename ``[link asio.reference.Service Service]``> friend bool has_service( - io_service & ios); + execution_context & e); -This function is used to determine whether the [link asio.reference.io_service `io_service`] contains a service object corresponding to the given service type. +This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. [heading Parameters] @@ -60774,14 +66122,14 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] ] [heading Return Value] -A boolean indicating whether the [link asio.reference.io_service `io_service`] contains the service. +A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. @@ -60856,17 +66204,20 @@ [section:notify_fork io_service::notify_fork] + +['Inherited from execution_context.] + [indexterm2 notify_fork..io_service] -Notify the [link asio.reference.io_service `io_service`] of a fork-related event. +Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. void notify_fork( - asio::io_service::fork_event event); + fork_event event); -This function is used to inform the [link asio.reference.io_service `io_service`] that the process is about to fork, or has just forked. This allows the [link asio.reference.io_service `io_service`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. +This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `execution_context`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. -This function must not be called while any other [link asio.reference.io_service `io_service`] function, or any function on an I/O object associated with the [link asio.reference.io_service `io_service`], is being called in another thread. It is, however, safe to call this function from within a completion handler, provided no other thread is accessing the [link asio.reference.io_service `io_service`]. +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the execution\_context's derived class, is being called in another thread. It is, however, safe to call this function from within a completion handler, provided no other thread is accessing the [link asio.reference.execution_context `execution_context`] or its derived class. [heading Parameters] @@ -60884,7 +66235,7 @@ [variablelist -[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.io_service `io_service`] object should no longer be used and should be destroyed.]] +[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] ] @@ -60893,16 +66244,16 @@ The following code illustrates how to incorporate the `notify_fork()` function: - my_io_service.notify_fork(asio::io_service::fork_prepare); + my_execution_context.notify_fork(execution_context::fork_prepare); if (fork() == 0) { // This is the child process. - my_io_service.notify_fork(asio::io_service::fork_child); + my_execution_context.notify_fork(execution_context::fork_child); } else { // This is the parent process. - my_io_service.notify_fork(asio::io_service::fork_parent); + my_execution_context.notify_fork(execution_context::fork_parent); } @@ -60911,7 +66262,7 @@ [heading Remarks] -For each service object `svc` in the [link asio.reference.io_service `io_service`] set, performs `svc->fork_service();`. When processing the fork\_prepare event, services are visited in reverse order of the beginning of service object lifetime. Otherwise, services are visited in order of the beginning of service object lifetime. +For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, performs `svc->fork_service();`. When processing the fork\_prepare event, services are visited in reverse order of the beginning of service object lifetime. Otherwise, services are visited in order of the beginning of service object lifetime. @@ -61087,7 +66438,7 @@ [section:post io_service::post] [indexterm2 post..io_service] -Request the [link asio.reference.io_service `io_service`] to invoke the given handler and return immediately. +(Deprecated: Use [link asio.reference.post `post`].) Request the [link asio.reference.io_service `io_service`] to invoke the given handler and return immediately. template< @@ -61135,13 +66486,31 @@ [section:reset io_service::reset] [indexterm2 reset..io_service] -Reset the [link asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation. +(Deprecated: Use `restart()`.) Reset the [link asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation. void reset(); -This function must be called prior to any second or later set of invocations of the `run()`, `run_one()`, `poll()` or `poll_one()` functions when a previous invocation of these functions returned due to the [link asio.reference.io_service `io_service`] being stopped or running out of work. After a call to `reset()`, the [link asio.reference.io_service `io_service`] object's `stopped()` function will return `false`. +This function must be called prior to any second or later set of invocations of the `run()`, `run_one()`, `poll()` or `poll_one()` functions when a previous invocation of these functions returned due to the [link asio.reference.io_service `io_service`] being stopped or running out of work. After a call to `restart()`, the [link asio.reference.io_service `io_service`] object's `stopped()` function will return `false`. + +This function must not be called while there are any unfinished calls to the `run()`, `run_one()`, `poll()` or `poll_one()` functions. + + +[endsect] + + + +[section:restart io_service::restart] + +[indexterm2 restart..io_service] +Restart the [link asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation. + + + void restart(); + + +This function must be called prior to any second or later set of invocations of the `run()`, `run_one()`, `poll()` or `poll_one()` functions when a previous invocation of these functions returned due to the [link asio.reference.io_service `io_service`] being stopped or running out of work. After a call to `restart()`, the [link asio.reference.io_service `io_service`] object's `stopped()` function will return `false`. This function must not be called while there are any unfinished calls to the `run()`, `run_one()`, `poll()` or `poll_one()` functions. @@ -61176,7 +66545,7 @@ Multiple threads may call the `run()` function to set up a pool of threads from which the [link asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link asio.reference.io_service `io_service`] may choose any one of them to invoke a handler. -A normal exit from the `run()` function implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`. +A normal exit from the `run()` function implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `restart()`. [heading Return Value] @@ -61219,7 +66588,7 @@ Multiple threads may call the `run()` function to set up a pool of threads from which the [link asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link asio.reference.io_service `io_service`] may choose any one of them to invoke a handler. -A normal exit from the `run()` function implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`. +A normal exit from the `run()` function implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `restart()`. [heading Parameters] @@ -61277,7 +66646,7 @@ [heading Return Value] -The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`. +The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `restart()`. [heading Exceptions] @@ -61311,7 +66680,7 @@ [heading Return Value] -The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`. +The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `restart()`. The number of handlers that were executed. @@ -61324,6 +66693,30 @@ [endsect] +[section:shutdown_context io_service::shutdown_context] + + +['Inherited from execution_context.] + +[indexterm2 shutdown_context..io_service] +Shuts down all services in the context. + + + void shutdown_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. + + + + +[endsect] + + + [section:stop io_service::stop] [indexterm2 stop..io_service] @@ -61333,7 +66726,7 @@ void stop(); -This function does not block, but instead simply signals the [link asio.reference.io_service `io_service`] to stop. All invocations of its `run()` or `run_one()` member functions should return as soon as possible. Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately until `reset()` is called. +This function does not block, but instead simply signals the [link asio.reference.io_service `io_service`] to stop. All invocations of its `run()` or `run_one()` member functions should return as soon as possible. Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately until `restart()` is called. [endsect] @@ -61362,15 +66755,33 @@ [endsect] - [section:use_service io_service::use_service] [indexterm2 use_service..io_service] + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.io_service.use_service.overload1 use_service]``( + io_service & ios); + `` [''''»''' [link asio.reference.io_service.use_service.overload1 more...]]`` + + Obtain the service object corresponding to the given type. template< typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.io_service.use_service.overload2 use_service]``( + execution_context & e); + `` [''''»''' [link asio.reference.io_service.use_service.overload2 more...]]`` + + +[section:overload1 io_service::use_service (1 of 2 overloads)] + + + + template< + typename ``[link asio.reference.Service Service]``> friend Service & use_service( io_service & ios); @@ -61383,7 +66794,57 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[i][The [link asio.reference.io_service `io_service`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + +[heading Remarks] + +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. + + + +[heading Requirements] + +['Header: ][^asio/io_service.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 io_service::use_service (2 of 2 overloads)] + + +['Inherited from execution_context.] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + execution_context & e); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.execution_context `execution_context`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] ] @@ -61404,11 +66865,13 @@ [endsect] +[endsect] + [section:wrap io_service::wrap] [indexterm2 wrap..io_service] -Create a new handler that automatically dispatches the wrapped handler on the [link asio.reference.io_service `io_service`]. +(Deprecated: Use [link asio.reference.wrap `wrap`].) Create a new handler that automatically dispatches the wrapped handler on the [link asio.reference.io_service `io_service`]. template< @@ -61505,14 +66968,13 @@ [endsect] -[section:io_service__id io_service::id] +[section:io_service__executor_type io_service::executor_type] -Class used to uniquely identify a service. +Executor used to submit functions to an [link asio.reference.io_service `io_service`]. - class id : - noncopyable + class executor_type [heading Member Functions] @@ -61520,8 +66982,54 @@ [[Name][Description]] [ - [[link asio.reference.io_service__id.id [*id]]] - [Constructor. ] + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] ] ] @@ -61533,13 +67041,233 @@ ['Convenience header: ][^asio.hpp] -[section:id io_service::id::id] +[section:context io_service::executor_type::context] -[indexterm2 id..io_service::id] -Constructor. +[indexterm2 context..io_service::executor_type] +Obtain the underlying execution context. - id(); + io_service & context(); + + + +[endsect] + + + +[section:defer io_service::executor_type::defer] + +[indexterm2 defer..io_service::executor_type] +Request the [link asio.reference.io_service `io_service`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the [link asio.reference.io_service `io_service`] to execute the given function object. The function object will never be executed inside `defer()`. Instead, it will be scheduled to run on the [link asio.reference.io_service `io_service`]. + +If the current thread belongs to the [link asio.reference.io_service `io_service`], `defer()` will delay scheduling the function object until the current thread returns control to the pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch io_service::executor_type::dispatch] + +[indexterm2 dispatch..io_service::executor_type] +Request the [link asio.reference.io_service `io_service`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the [link asio.reference.io_service `io_service`] to execute the given function object. If the current thread is running the [link asio.reference.io_service `io_service`], `dispatch()` executes the function before returning. Otherwise, the function will be scheduled to run on the [link asio.reference.io_service `io_service`]. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:on_work_finished io_service::executor_type::on_work_finished] + +[indexterm2 on_work_finished..io_service::executor_type] +Inform the [link asio.reference.io_service `io_service`] that some work is no longer outstanding. + + + void on_work_finished(); + + +This function is used to inform the [link asio.reference.io_service `io_service`] that some work has finished. Once the count of unfinished work reaches zero, the [link asio.reference.io_service `io_service`] is stopped and the `run()` and `run_one()` functions may exit. + + +[endsect] + + + +[section:on_work_started io_service::executor_type::on_work_started] + +[indexterm2 on_work_started..io_service::executor_type] +Inform the [link asio.reference.io_service `io_service`] that it has some outstanding work to do. + + + void on_work_started(); + + +This function is used to inform the [link asio.reference.io_service `io_service`] that some work has begun. This ensures that the io\_service's `run()` and `run_one()` functions do not exit while the work is underway. + + +[endsect] + + + +[section:operator_not__eq_ io_service::executor_type::operator!=] + +[indexterm2 operator!=..io_service::executor_type] +Compare two executors for inequality. + + + friend bool operator!=( + const executor_type & a, + const executor_type & b); + + +Two executors are equal if they refer to the same underlying [link asio.reference.io_service `io_service`]. + +[heading Requirements] + +['Header: ][^asio/io_service.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ io_service::executor_type::operator==] + +[indexterm2 operator==..io_service::executor_type] +Compare two executors for equality. + + + friend bool operator==( + const executor_type & a, + const executor_type & b); + + +Two executors are equal if they refer to the same underlying [link asio.reference.io_service `io_service`]. + +[heading Requirements] + +['Header: ][^asio/io_service.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:post io_service::executor_type::post] + +[indexterm2 post..io_service::executor_type] +Request the [link asio.reference.io_service `io_service`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the [link asio.reference.io_service `io_service`] to execute the given function object. The function object will never be executed inside `post()`. Instead, it will be scheduled to run on the [link asio.reference.io_service `io_service`]. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:running_in_this_thread io_service::executor_type::running_in_this_thread] + +[indexterm2 running_in_this_thread..io_service::executor_type] +Determine whether the [link asio.reference.io_service `io_service`] is running in the current thread. + + + bool running_in_this_thread() const; + + + +[heading Return Value] + +`true` if the current thread is running the [link asio.reference.io_service `io_service`]. Otherwise returns `false`. + @@ -61555,8 +67283,7 @@ Base class for all [link asio.reference.io_service `io_service`] services. - class service : - noncopyable + class service [heading Member Functions] @@ -61586,22 +67313,6 @@ ] -[heading Private Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.io_service__service.fork_service [*fork_service]]] - [Handle notification of a fork-related event to perform any necessary housekeeping. ] - ] - - [ - [[link asio.reference.io_service__service.shutdown_service [*shutdown_service]]] - [Destroy all user-defined handler objects owned by the service. ] - ] - -] - [heading Requirements] ['Header: ][^asio/io_service.hpp] @@ -61664,37 +67375,6 @@ -[section:fork_service io_service::service::fork_service] - -[indexterm2 fork_service..io_service::service] -Handle notification of a fork-related event to perform any necessary housekeeping. - - - virtual void fork_service( - asio::io_service::fork_event event); - - -This function is not a pure virtual so that services only have to implement it if necessary. The default implementation does nothing. - - -[endsect] - - - -[section:shutdown_service io_service::service::shutdown_service] - -[indexterm2 shutdown_service..io_service::service] -Destroy all user-defined handler objects owned by the service. - - - void shutdown_service(); - - - -[endsect] - - - [endsect] [section:io_service__strand io_service::strand] @@ -61711,18 +67391,42 @@ [[Name][Description]] [ + [[link asio.reference.io_service__strand.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__strand.defer [*defer]]] + [Request the strand to invoke the given function object. ] + ] + + [ [[link asio.reference.io_service__strand.dispatch [*dispatch]]] - [Request the strand to invoke the given handler. ] + [Request the strand to invoke the given function object. + + (Deprecated: Use asio::dispatch().) Request the strand to invoke the given handler. ] ] [ [[link asio.reference.io_service__strand.get_io_service [*get_io_service]]] - [Get the io_service associated with the strand. ] + [(Deprecated: Use context().) Get the io_service associated with the strand. ] + ] + + [ + [[link asio.reference.io_service__strand.on_work_finished [*on_work_finished]]] + [Inform the strand that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__strand.on_work_started [*on_work_started]]] + [Inform the strand that it has some outstanding work to do. ] ] [ [[link asio.reference.io_service__strand.post [*post]]] - [Request the strand to invoke the given handler and return immediately. ] + [Request the strand to invoke the given function object. + + (Deprecated: Use asio::post().) Request the strand to invoke the given handler and return immediately. ] ] [ @@ -61737,7 +67441,7 @@ [ [[link asio.reference.io_service__strand.wrap [*wrap]]] - [Create a new handler that automatically dispatches the wrapped handler on the strand. ] + [(Deprecated: Use asio::wrap().) Create a new handler that automatically dispatches the wrapped handler on the strand. ] ] [ @@ -61747,6 +67451,22 @@ ] +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__strand.operator_not__eq_ [*operator!=]]] + [Compare two strands for inequality. ] + ] + + [ + [[link asio.reference.io_service__strand.operator_eq__eq_ [*operator==]]] + [Compare two strands for equality. ] + ] + +] + The [link asio.reference.io_service__strand `io_service::strand`] class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently. @@ -61810,15 +67530,131 @@ [heading Requirements] -['Header: ][^asio/strand.hpp] +['Header: ][^asio/io_service_strand.hpp] ['Convenience header: ][^asio.hpp] +[section:context io_service::strand::context] + +[indexterm2 context..io_service::strand] +Obtain the underlying execution context. + + + asio::io_service & context(); + + + +[endsect] + + + +[section:defer io_service::strand::defer] + +[indexterm2 defer..io_service::strand] +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled to run by the underlying [link asio.reference.io_service `io_service`]. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + [section:dispatch io_service::strand::dispatch] [indexterm2 dispatch..io_service::strand] -Request the strand to invoke the given handler. +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void ``[link asio.reference.io_service__strand.dispatch.overload1 dispatch]``( + Function f, + const Allocator & a); + `` [''''»''' [link asio.reference.io_service__strand.dispatch.overload1 more...]]`` + + +(Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the strand to invoke the given handler. + + + template< + typename ``[link asio.reference.CompletionHandler CompletionHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.io_service__strand.dispatch.overload2 dispatch]``( + CompletionHandler handler); + `` [''''»''' [link asio.reference.io_service__strand.dispatch.overload2 more...]]`` + + +[section:overload1 io_service::strand::dispatch (1 of 2 overloads)] + + +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the strand to execute the given function object on its underlying [link asio.reference.io_service `io_service`]. The function object will be executed inside this function if the strand is not otherwise busy and if the underlying io\_service's executor's `dispatch()` function is also able to execute the function before returning. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:overload2 io_service::strand::dispatch (2 of 2 overloads)] + + +(Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the strand to invoke the given handler. template< @@ -61853,11 +67689,13 @@ [endsect] +[endsect] + [section:get_io_service io_service::strand::get_io_service] [indexterm2 get_io_service..io_service::strand] -Get the [link asio.reference.io_service `io_service`] associated with the strand. +(Deprecated: Use `context()`.) Get the [link asio.reference.io_service `io_service`] associated with the strand. asio::io_service & get_io_service(); @@ -61877,10 +67715,153 @@ +[section:on_work_finished io_service::strand::on_work_finished] + +[indexterm2 on_work_finished..io_service::strand] +Inform the strand that some work is no longer outstanding. + + + void on_work_finished(); + + +The strand delegates this call to its underlying [link asio.reference.io_service `io_service`]. + + +[endsect] + + + +[section:on_work_started io_service::strand::on_work_started] + +[indexterm2 on_work_started..io_service::strand] +Inform the strand that it has some outstanding work to do. + + + void on_work_started(); + + +The strand delegates this call to its underlying [link asio.reference.io_service `io_service`]. + + +[endsect] + + + +[section:operator_not__eq_ io_service::strand::operator!=] + +[indexterm2 operator!=..io_service::strand] +Compare two strands for inequality. + + + friend bool operator!=( + const strand & a, + const strand & b); + + +Two strands are equal if they refer to the same ordered, non-concurrent state. + +[heading Requirements] + +['Header: ][^asio/io_service_strand.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ io_service::strand::operator==] + +[indexterm2 operator==..io_service::strand] +Compare two strands for equality. + + + friend bool operator==( + const strand & a, + const strand & b); + + +Two strands are equal if they refer to the same ordered, non-concurrent state. + +[heading Requirements] + +['Header: ][^asio/io_service_strand.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:post io_service::strand::post] [indexterm2 post..io_service::strand] -Request the strand to invoke the given handler and return immediately. +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void ``[link asio.reference.io_service__strand.post.overload1 post]``( + Function f, + const Allocator & a); + `` [''''»''' [link asio.reference.io_service__strand.post.overload1 more...]]`` + + +(Deprecated: Use [link asio.reference.post `post`].) Request the strand to invoke the given handler and return immediately. + + + template< + typename ``[link asio.reference.CompletionHandler CompletionHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.io_service__strand.post.overload2 post]``( + CompletionHandler handler); + `` [''''»''' [link asio.reference.io_service__strand.post.overload2 more...]]`` + + +[section:overload1 io_service::strand::post (1 of 2 overloads)] + + +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled to run by the underlying [link asio.reference.io_service `io_service`]. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:overload2 io_service::strand::post (2 of 2 overloads)] + + +(Deprecated: Use [link asio.reference.post `post`].) Request the strand to invoke the given handler and return immediately. template< @@ -61913,6 +67894,8 @@ [endsect] +[endsect] + [section:running_in_this_thread io_service::strand::running_in_this_thread] @@ -61967,7 +67950,7 @@ [section:wrap io_service::strand::wrap] [indexterm2 wrap..io_service::strand] -Create a new handler that automatically dispatches the wrapped handler on the strand. +(Deprecated: Use [link asio.reference.wrap `wrap`].) Create a new handler that automatically dispatches the wrapped handler on the strand. template< @@ -62199,7 +68182,7 @@ [ [[link asio.reference.ip__address.from_string [*from_string]]] - [Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. ] + [(Deprecated: Use make_address().) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. ] ] [ @@ -62294,6 +68277,11 @@ [[Name][Description]] [ + [[link asio.reference.ip__address.make_address [*make_address]]] + [Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. ] + ] + + [ [[link asio.reference.ip__address.operator_lt__lt_ [*operator<<]]] [Output an address as a string. ] ] @@ -62414,7 +68402,7 @@ [section:from_string ip::address::from_string] [indexterm2 from_string..ip::address] -Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +(Deprecated: Use `make_address()`.) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. static address ``[link asio.reference.ip__address.from_string.overload1 from_string]``( @@ -62439,7 +68427,7 @@ [section:overload1 ip::address::from_string (1 of 4 overloads)] -Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +(Deprecated: Use `make_address()`.) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. static address from_string( @@ -62454,7 +68442,7 @@ [section:overload2 ip::address::from_string (2 of 4 overloads)] -Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +(Deprecated: Use `make_address()`.) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. static address from_string( @@ -62470,7 +68458,7 @@ [section:overload3 ip::address::from_string (3 of 4 overloads)] -Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +(Deprecated: Use `make_address()`.) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. static address from_string( @@ -62485,7 +68473,7 @@ [section:overload4 ip::address::from_string (4 of 4 overloads)] -Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. +(Deprecated: Use `make_address()`.) Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. static address from_string( @@ -62569,6 +68557,94 @@ [endsect] +[section:make_address ip::address::make_address] + +[indexterm2 make_address..ip::address] +Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. + + + address ``[link asio.reference.ip__address.make_address.overload1 make_address]``( + const char * str); + `` [''''»''' [link asio.reference.ip__address.make_address.overload1 more...]]`` + + address ``[link asio.reference.ip__address.make_address.overload2 make_address]``( + const char * str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address.make_address.overload2 more...]]`` + + address ``[link asio.reference.ip__address.make_address.overload3 make_address]``( + const std::string & str); + `` [''''»''' [link asio.reference.ip__address.make_address.overload3 more...]]`` + + address ``[link asio.reference.ip__address.make_address.overload4 make_address]``( + const std::string & str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address.make_address.overload4 more...]]`` + + +[section:overload1 ip::address::make_address (1 of 4 overloads)] + + +Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. + + + address make_address( + const char * str); + + + +[endsect] + + + +[section:overload2 ip::address::make_address (2 of 4 overloads)] + + +Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. + + + address make_address( + const char * str, + asio::error_code & ec); + + + +[endsect] + + + +[section:overload3 ip::address::make_address (3 of 4 overloads)] + + +Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. + + + address make_address( + const std::string & str); + + + +[endsect] + + + +[section:overload4 ip::address::make_address (4 of 4 overloads)] + + +Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. + + + address make_address( + const std::string & str, + asio::error_code & ec); + + + +[endsect] + + +[endsect] + [section:operator_not__eq_ ip::address::operator!=] @@ -62889,6 +68965,269 @@ [endsect] +[section:ip__address_cast ip::address_cast] + +[indexterm1 ip::address_cast] +Cast a version-independent address to itself. + + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload1 address_cast]``( + const address & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload1 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload2 address_cast]``( + const address & addr, + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload2 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload3 address_cast]``( + const address & addr, + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload3 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload4 address_cast]``( + const address_v4 & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload4 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload5 address_cast]``( + const address_v4 & addr, + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload5 more...]]`` + + template< + typename T> + bad_address_cast ``[link asio.reference.ip__address_cast.overload6 address_cast]``( + const address_v4 & , + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload6 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload7 address_cast]``( + const address_v6 & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload7 more...]]`` + + template< + typename T> + T ``[link asio.reference.ip__address_cast.overload8 address_cast]``( + const address_v6 & addr, + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload8 more...]]`` + + template< + typename T> + bad_address_cast ``[link asio.reference.ip__address_cast.overload9 address_cast]``( + const address_v6 & , + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + `` [''''»''' [link asio.reference.ip__address_cast.overload9 more...]]`` + +[heading Requirements] + +['Header: ][^asio/ip/address.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 ip::address_cast (1 of 9 overloads)] + + +Cast a version-independent address to itself. + + + template< + typename T> + T address_cast( + const address & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + + + +[endsect] + + + +[section:overload2 ip::address_cast (2 of 9 overloads)] + + +Cast a version-independent address to an IPv4 address. + + + template< + typename T> + T address_cast( + const address & addr, + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + + + +[heading Exceptions] + + +[variablelist + +[[bad_address_cast][if `a` does not represent an IPv4 address. ]] + +] + + + + +[endsect] + + + +[section:overload3 ip::address_cast (3 of 9 overloads)] + + +Cast a version-independent address to an IPv6 address. + + + template< + typename T> + T address_cast( + const address & addr, + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + + + +[heading Exceptions] + + +[variablelist + +[[bad_address_cast][if `a` does not represent an IPv6 address. ]] + +] + + + + +[endsect] + + + +[section:overload4 ip::address_cast (4 of 9 overloads)] + + +Cast an IPv4 address to a version-independent address. + + + template< + typename T> + T address_cast( + const address_v4 & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + + + +[endsect] + + + +[section:overload5 ip::address_cast (5 of 9 overloads)] + + +Cast an IPv4 address to itself. + + + template< + typename T> + T address_cast( + const address_v4 & addr, + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + + + +[endsect] + + + +[section:overload6 ip::address_cast (6 of 9 overloads)] + + +Cast from IPv4 to IPV6 address is not permitted. + + + template< + typename T> + bad_address_cast address_cast( + const address_v4 & , + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + + + +[endsect] + + + +[section:overload7 ip::address_cast (7 of 9 overloads)] + + +Cast an IPv6 address to a version-independent address. + + + template< + typename T> + T address_cast( + const address_v6 & addr, + typename enable_if< is_same< T, address >::value >::type * = 0); + + + +[endsect] + + + +[section:overload8 ip::address_cast (8 of 9 overloads)] + + +Cast an IPv6 address to itself. + + + template< + typename T> + T address_cast( + const address_v6 & addr, + typename enable_if< is_same< T, address_v6 >::value >::type * = 0); + + + +[endsect] + + + +[section:overload9 ip::address_cast (9 of 9 overloads)] + + +Cast from IPv6 to IPv4 address is not permitted. + + + template< + typename T> + bad_address_cast address_cast( + const address_v6 & , + typename enable_if< is_same< T, address_v4 >::value >::type * = 0); + + + +[endsect] + + +[endsect] + [section:ip__address_v4 ip::address_v4] @@ -62921,7 +69260,7 @@ Construct an address from raw bytes. - Construct an address from a unsigned long in host byte order. + Construct an address from an unsigned long in host byte order. Copy constructor. ] ] @@ -62940,7 +69279,7 @@ [ [[link asio.reference.ip__address_v4.from_string [*from_string]]] - [Create an address from an IP address string in dotted decimal form. ] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] ] [ @@ -63046,6 +69385,15 @@ [[Name][Description]] [ + [[link asio.reference.ip__address_v4.make_address_v4 [*make_address_v4]]] + [Create an IPv4 address from raw bytes in network order. + + Create an IPv4 address from an unsigned long in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. ] + ] + + [ [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] [Output an address as a string. ] ] @@ -63087,7 +69435,7 @@ `` [''''»''' [link asio.reference.ip__address_v4.address_v4.overload2 more...]]`` -Construct an address from a unsigned long in host byte order. +Construct an address from an unsigned long in host byte order. explicit ``[link asio.reference.ip__address_v4.address_v4.overload3 address_v4]``( @@ -63135,7 +69483,7 @@ [section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)] -Construct an address from a unsigned long in host byte order. +Construct an address from an unsigned long in host byte order. address_v4( @@ -63258,7 +69606,7 @@ [section:from_string ip::address_v4::from_string] [indexterm2 from_string..ip::address_v4] -Create an address from an IP address string in dotted decimal form. +(Deprecated: Use `make_address_v4()`.) Create an address from an IP address string in dotted decimal form. static address_v4 ``[link asio.reference.ip__address_v4.from_string.overload1 from_string]``( @@ -63283,7 +69631,7 @@ [section:overload1 ip::address_v4::from_string (1 of 4 overloads)] -Create an address from an IP address string in dotted decimal form. +(Deprecated: Use `make_address_v4()`.) Create an address from an IP address string in dotted decimal form. static address_v4 from_string( @@ -63298,7 +69646,7 @@ [section:overload2 ip::address_v4::from_string (2 of 4 overloads)] -Create an address from an IP address string in dotted decimal form. +(Deprecated: Use `make_address_v4()`.) Create an address from an IP address string in dotted decimal form. static address_v4 from_string( @@ -63314,7 +69662,7 @@ [section:overload3 ip::address_v4::from_string (3 of 4 overloads)] -Create an address from an IP address string in dotted decimal form. +(Deprecated: Use `make_address_v4()`.) Create an address from an IP address string in dotted decimal form. static address_v4 from_string( @@ -63329,7 +69677,7 @@ [section:overload4 ip::address_v4::from_string (4 of 4 overloads)] -Create an address from an IP address string in dotted decimal form. +(Deprecated: Use `make_address_v4()`.) Create an address from an IP address string in dotted decimal form. static address_v4 from_string( @@ -63441,6 +69789,140 @@ [endsect] +[section:make_address_v4 ip::address_v4::make_address_v4] + +[indexterm2 make_address_v4..ip::address_v4] +Create an IPv4 address from raw bytes in network order. + + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload1 make_address_v4]``( + const address_v4::bytes_type & bytes); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload1 more...]]`` + + +Create an IPv4 address from an unsigned long in host byte order. + + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload2 make_address_v4]``( + unsigned long addr); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload2 more...]]`` + + +Create an IPv4 address from an IP address string in dotted decimal form. + + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload3 make_address_v4]``( + const char * str); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload3 more...]]`` + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload4 make_address_v4]``( + const char * str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload4 more...]]`` + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload5 make_address_v4]``( + const std::string & str); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload5 more...]]`` + + address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload6 make_address_v4]``( + const std::string & str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload6 more...]]`` + + +[section:overload1 ip::address_v4::make_address_v4 (1 of 6 overloads)] + + +Create an IPv4 address from raw bytes in network order. + + + address_v4 make_address_v4( + const address_v4::bytes_type & bytes); + + + +[endsect] + + + +[section:overload2 ip::address_v4::make_address_v4 (2 of 6 overloads)] + + +Create an IPv4 address from an unsigned long in host byte order. + + + address_v4 make_address_v4( + unsigned long addr); + + + +[endsect] + + + +[section:overload3 ip::address_v4::make_address_v4 (3 of 6 overloads)] + + +Create an IPv4 address from an IP address string in dotted decimal form. + + + address_v4 make_address_v4( + const char * str); + + + +[endsect] + + + +[section:overload4 ip::address_v4::make_address_v4 (4 of 6 overloads)] + + +Create an IPv4 address from an IP address string in dotted decimal form. + + + address_v4 make_address_v4( + const char * str, + asio::error_code & ec); + + + +[endsect] + + + +[section:overload5 ip::address_v4::make_address_v4 (5 of 6 overloads)] + + +Create an IPv4 address from an IP address string in dotted decimal form. + + + address_v4 make_address_v4( + const std::string & str); + + + +[endsect] + + + +[section:overload6 ip::address_v4::make_address_v4 (6 of 6 overloads)] + + +Create an IPv4 address from an IP address string in dotted decimal form. + + + address_v4 make_address_v4( + const std::string & str, + asio::error_code & ec); + + + +[endsect] + + +[endsect] + [section:netmask ip::address_v4::netmask] @@ -63760,7 +70242,7 @@ [ [[link asio.reference.ip__address_v6.from_string [*from_string]]] - [Create an address from an IP address string. ] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] ] [ @@ -63815,7 +70297,7 @@ [ [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] - [Determine whether the address is an IPv4-compatible address. ] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] ] [ @@ -63850,17 +70332,17 @@ [ [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] - [Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. ] + [(Deprecated: Use make_address_v4().) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. ] ] [ [[link asio.reference.ip__address_v6.v4_compatible [*v4_compatible]]] - [Create an IPv4-compatible IPv6 address. ] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] ] [ [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] - [Create an IPv4-mapped IPv6 address. ] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] ] ] @@ -63906,6 +70388,15 @@ [[Name][Description]] [ + [[link asio.reference.ip__address_v6.make_address_v6 [*make_address_v6]]] + [Create an IPv6 address from raw bytes and scope ID. + + Create an IPv6 address from an IP address string. + + Createan IPv6 address from an IP address string. ] + ] + + [ [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] [Output an address as a string. ] ] @@ -64047,7 +70538,7 @@ [section:from_string ip::address_v6::from_string] [indexterm2 from_string..ip::address_v6] -Create an address from an IP address string. +(Deprecated: Use `make_address_v6()`.) Create an IPv6 address from an IP address string. static address_v6 ``[link asio.reference.ip__address_v6.from_string.overload1 from_string]``( @@ -64072,7 +70563,7 @@ [section:overload1 ip::address_v6::from_string (1 of 4 overloads)] -Create an address from an IP address string. +(Deprecated: Use `make_address_v6()`.) Create an IPv6 address from an IP address string. static address_v6 from_string( @@ -64087,7 +70578,7 @@ [section:overload2 ip::address_v6::from_string (2 of 4 overloads)] -Create an address from an IP address string. +(Deprecated: Use `make_address_v6()`.) Create an IPv6 address from an IP address string. static address_v6 from_string( @@ -64103,7 +70594,7 @@ [section:overload3 ip::address_v6::from_string (3 of 4 overloads)] -Create an address from an IP address string. +(Deprecated: Use `make_address_v6()`.) Create an IPv6 address from an IP address string. static address_v6 from_string( @@ -64118,7 +70609,7 @@ [section:overload4 ip::address_v6::from_string (4 of 4 overloads)] -Create an address from an IP address string. +(Deprecated: Use `make_address_v6()`.) Create an IPv6 address from an IP address string. static address_v6 from_string( @@ -64276,7 +70767,7 @@ [section:is_v4_compatible ip::address_v6::is_v4_compatible] [indexterm2 is_v4_compatible..ip::address_v6] -Determine whether the address is an IPv4-compatible address. +(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. bool is_v4_compatible() const; @@ -64314,6 +70805,123 @@ [endsect] +[section:make_address_v6 ip::address_v6::make_address_v6] + +[indexterm2 make_address_v6..ip::address_v6] +Create an IPv6 address from raw bytes and scope ID. + + + address_v6 ``[link asio.reference.ip__address_v6.make_address_v6.overload1 make_address_v6]``( + const address_v6::bytes_type & bytes, + unsigned long scope_id = 0); + `` [''''»''' [link asio.reference.ip__address_v6.make_address_v6.overload1 more...]]`` + + +Create an IPv6 address from an IP address string. + + + address_v6 ``[link asio.reference.ip__address_v6.make_address_v6.overload2 make_address_v6]``( + const char * str); + `` [''''»''' [link asio.reference.ip__address_v6.make_address_v6.overload2 more...]]`` + + address_v6 ``[link asio.reference.ip__address_v6.make_address_v6.overload3 make_address_v6]``( + const char * str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address_v6.make_address_v6.overload3 more...]]`` + + +Createan IPv6 address from an IP address string. + + + address_v6 ``[link asio.reference.ip__address_v6.make_address_v6.overload4 make_address_v6]``( + const std::string & str); + `` [''''»''' [link asio.reference.ip__address_v6.make_address_v6.overload4 more...]]`` + + address_v6 ``[link asio.reference.ip__address_v6.make_address_v6.overload5 make_address_v6]``( + const std::string & str, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__address_v6.make_address_v6.overload5 more...]]`` + + +[section:overload1 ip::address_v6::make_address_v6 (1 of 5 overloads)] + + +Create an IPv6 address from raw bytes and scope ID. + + + address_v6 make_address_v6( + const address_v6::bytes_type & bytes, + unsigned long scope_id = 0); + + + +[endsect] + + + +[section:overload2 ip::address_v6::make_address_v6 (2 of 5 overloads)] + + +Create an IPv6 address from an IP address string. + + + address_v6 make_address_v6( + const char * str); + + + +[endsect] + + + +[section:overload3 ip::address_v6::make_address_v6 (3 of 5 overloads)] + + +Create an IPv6 address from an IP address string. + + + address_v6 make_address_v6( + const char * str, + asio::error_code & ec); + + + +[endsect] + + + +[section:overload4 ip::address_v6::make_address_v6 (4 of 5 overloads)] + + +Createan IPv6 address from an IP address string. + + + address_v6 make_address_v6( + const std::string & str); + + + +[endsect] + + + +[section:overload5 ip::address_v6::make_address_v6 (5 of 5 overloads)] + + +Create an IPv6 address from an IP address string. + + + address_v6 make_address_v6( + const std::string & str, + asio::error_code & ec); + + + +[endsect] + + +[endsect] + [section:operator_not__eq_ ip::address_v6::operator!=] @@ -64611,7 +71219,7 @@ [section:to_v4 ip::address_v6::to_v4] [indexterm2 to_v4..ip::address_v6] -Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. +(Deprecated: Use [link asio.reference.ip__make_address_v4 `ip::make_address_v4`].) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. address_v4 to_v4() const; @@ -64625,7 +71233,7 @@ [section:v4_compatible ip::address_v6::v4_compatible] [indexterm2 v4_compatible..ip::address_v6] -Create an IPv4-compatible IPv6 address. +(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. static address_v6 v4_compatible( @@ -64640,7 +71248,7 @@ [section:v4_mapped ip::address_v6::v4_mapped] [indexterm2 v4_mapped..ip::address_v6] -Create an IPv4-mapped IPv6 address. +(Deprecated: Use `make_address_v6()`.) Create an IPv4-mapped IPv6 address. static address_v6 v4_mapped( @@ -64654,6 +71262,87 @@ [endsect] +[section:ip__bad_address_cast ip::bad_address_cast] + + +Thrown to indicate a failed address conversion. + + + class bad_address_cast + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__bad_address_cast.bad_address_cast [*bad_address_cast]]] + [Default constructor. ] + ] + + [ + [[link asio.reference.ip__bad_address_cast.what [*what]]] + [Get the message associated with the exception. ] + ] + + [ + [[link asio.reference.ip__bad_address_cast._bad_address_cast [*~bad_address_cast]]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/bad_address_cast.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:bad_address_cast ip::bad_address_cast::bad_address_cast] + +[indexterm2 bad_address_cast..ip::bad_address_cast] +Default constructor. + + + bad_address_cast(); + + + +[endsect] + + + +[section:what ip::bad_address_cast::what] + +[indexterm2 what..ip::bad_address_cast] +Get the message associated with the exception. + + + virtual const char * what() const; + + + +[endsect] + + + +[section:_bad_address_cast ip::bad_address_cast::~bad_address_cast] + +[indexterm2 ~bad_address_cast..ip::bad_address_cast] +Destructor. + + + virtual ~bad_address_cast(); + + + +[endsect] + + + +[endsect] + [section:ip__basic_endpoint ip::basic_endpoint] @@ -65376,6 +72065,13 @@ [ + [[link asio.reference.ip__basic_resolver.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -65433,8 +72129,13 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -65462,22 +72163,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.ip__basic_resolver.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -65683,6 +72368,104 @@ [endsect] + +[section:executor_type ip::basic_resolver::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..ip::basic_resolver] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor ip::basic_resolver::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..ip::basic_resolver] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation ip::basic_resolver::get_implementation] [indexterm2 get_implementation..ip::basic_resolver] @@ -65738,7 +72521,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..ip::basic_resolver] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -65806,23 +72589,6 @@ [endsect] -[section:implementation ip::basic_resolver::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..ip::basic_resolver] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type ip::basic_resolver::implementation_type] @@ -66338,30 +73104,6 @@ [endsect] -[section:service ip::basic_resolver::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..ip::basic_resolver] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type ip::basic_resolver::service_type] @@ -68154,6 +74896,13 @@ [ + [[link asio.reference.ip__basic_resolver.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -68211,8 +74960,13 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -68240,22 +74994,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.ip__basic_resolver.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -68336,6 +75074,13 @@ [ + [[link asio.reference.basic_raw_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_raw_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -68378,20 +75123,6 @@ [ - [[link asio.reference.basic_raw_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_raw_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -68446,6 +75177,13 @@ ] + [ + + [[link asio.reference.basic_raw_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -68483,6 +75221,11 @@ ] [ + [[link asio.reference.basic_raw_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 asio.reference.basic_raw_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -68528,8 +75271,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -68560,11 +75308,6 @@ ] [ - [[link asio.reference.basic_raw_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_raw_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -68630,6 +75373,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.basic_raw_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -68679,22 +75427,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_raw_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_raw_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_raw_socket `basic_raw_socket`] class template provides asynchronous and blocking raw-oriented socket functionality. @@ -68763,6 +75495,50 @@ [endsect] +[section:ip__make_address_v4 ip::make_address_v4] + +[indexterm1 ip::make_address_v4] +Create an IPv4 address from a IPv4-mapped IPv6 address. + + + address_v4 make_address_v4( + v4_mapped_t , + const address_v6 & v6_addr); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:ip__make_address_v6 ip::make_address_v6] + +[indexterm1 ip::make_address_v6] +Create an IPv4-mapped IPv6 address from an IPv4 address. + + + address_v6 make_address_v6( + v4_mapped_t , + const address_v4 & v4_addr); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:ip__multicast__enable_loopback ip::multicast::enable_loopback] [indexterm1 ip::multicast::enable_loopback] @@ -70037,6 +76813,13 @@ [ + [[link asio.reference.basic_socket_acceptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -70072,20 +76855,6 @@ [ - [[link asio.reference.basic_socket_acceptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ] - - ] - - [ - - [[link asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]] [The protocol type. ] @@ -70140,6 +76909,13 @@ ] + [ + + [[link asio.reference.basic_socket_acceptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -70194,8 +76970,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -70224,11 +77005,6 @@ ] [ - [[link asio.reference.basic_socket_acceptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native acceptor representation. ] - ] - - [ [[link asio.reference.basic_socket_acceptor.native_handle [*native_handle]]] [Get the native acceptor representation. ] ] @@ -70313,22 +77089,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket_acceptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket_acceptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections. @@ -70557,13 +77317,20 @@ [ - [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [[link asio.reference.basic_socket_iostream.duration [*duration]]] [The duration type. ] ] [ + [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [(Deprecated: Use duration.) The duration type. ] + + ] + + [ + [[link asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]] [The endpoint type. ] @@ -70571,11 +77338,18 @@ [ - [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [[link asio.reference.basic_socket_iostream.time_point [*time_point]]] [The time type. ] ] + [ + + [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [(Deprecated: Use time_point.) The time type. ] + + ] + ] [heading Member Functions] @@ -70605,17 +77379,27 @@ ] [ + [[link asio.reference.basic_socket_iostream.expires_after [*expires_after]]] + [Set the stream's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_socket_iostream.expires_at [*expires_at]]] - [Get the stream's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the stream's expiry time as an absolute time. Set the stream's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the stream's expiry time relative to now. - Set the stream's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the stream's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_socket_iostream.expiry [*expiry]]] + [Get the stream's expiry time as an absolute time. ] ] [ @@ -70768,6 +77552,13 @@ [ + [[link asio.reference.ip__basic_resolver.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -70825,8 +77616,13 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -70854,22 +77650,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.ip__basic_resolver.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -70950,6 +77730,13 @@ [ + [[link asio.reference.basic_stream_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_stream_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -70992,20 +77779,6 @@ [ - [[link asio.reference.basic_stream_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_stream_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -71060,6 +77833,13 @@ ] + [ + + [[link asio.reference.basic_stream_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -71092,6 +77872,11 @@ ] [ + [[link asio.reference.basic_stream_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 asio.reference.basic_stream_socket.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -71142,8 +77927,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -71174,11 +77964,6 @@ ] [ - [[link asio.reference.basic_stream_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_stream_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -71242,6 +78027,11 @@ ] [ + [[link asio.reference.basic_stream_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_stream_socket.write_some [*write_some]]] [Write some data to the socket. ] ] @@ -71295,22 +78085,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_stream_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_stream_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality. @@ -71736,6 +78510,13 @@ [ + [[link asio.reference.ip__basic_resolver.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -71793,8 +78574,13 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -71822,22 +78608,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__basic_resolver.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.ip__basic_resolver.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -71918,6 +78688,13 @@ [ + [[link asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -71960,20 +78737,6 @@ [ - [[link asio.reference.basic_datagram_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -72028,6 +78791,13 @@ ] + [ + + [[link asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -72065,6 +78835,11 @@ ] [ + [[link 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 asio.reference.basic_datagram_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -72110,8 +78885,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -72142,11 +78922,6 @@ ] [ - [[link asio.reference.basic_datagram_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_datagram_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -72212,6 +78987,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -72261,22 +79041,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_datagram_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_datagram_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. @@ -72396,6 +79160,38 @@ +[section:ip__v4_mapped_t ip::v4_mapped_t] + +[indexterm1 ip::v4_mapped_t] +Tag type used for distinguishing overloads that deal in IPv4-mapped IPv6 addresses. + + + enum v4_mapped_t + +[indexterm2 v4_mapped..ip::v4_mapped_t] + +[heading Values] +[variablelist + + [ + [v4_mapped] + [] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:ip__v6_only ip::v6_only] [indexterm1 ip::v6_only] @@ -72446,6 +79242,48 @@ [endsect] +[section:is_const_buffer_sequence is_const_buffer_sequence] + + +Trait to determine whether a type satisfies the ConstBufferSequence requirements. + + + template< + typename T> + struct is_const_buffer_sequence + + +[heading Requirements] + +['Header: ][^asio/buffer.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + +[section:is_executor is_executor] + + +The [link asio.reference.is_executor `is_executor`] trait detects whether a type T meets the Executor type requirements. + + + template< + typename T> + struct is_executor + + +Meets the UnaryTypeTrait requirements. The asio library implementation provides a definition that is derived from false\_type. A program may specialise this template to derive from true\_type for a user-defined type T that meets the Executor requirements. + +[heading Requirements] + +['Header: ][^asio/is_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + [section:is_match_condition is_match_condition] @@ -72491,6 +79329,26 @@ [endsect] +[section:is_mutable_buffer_sequence is_mutable_buffer_sequence] + + +Trait to determine whether a type satisfies the MutableBufferSequence requirements. + + + template< + typename T> + struct is_mutable_buffer_sequence + + +[heading Requirements] + +['Header: ][^asio/buffer.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + [section:is_read_buffered is_read_buffered] @@ -73594,6 +80452,13 @@ [ + [[link asio.reference.basic_datagram_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -73636,20 +80501,6 @@ [ - [[link asio.reference.basic_datagram_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -73704,6 +80555,13 @@ ] + [ + + [[link asio.reference.basic_datagram_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -73741,6 +80599,11 @@ ] [ + [[link 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 asio.reference.basic_datagram_socket.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -73786,8 +80649,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -73818,11 +80686,6 @@ ] [ - [[link asio.reference.basic_datagram_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_datagram_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -73888,6 +80751,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link 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. ] + ] + ] [heading Protected Member Functions] @@ -73937,22 +80805,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_datagram_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_datagram_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality. @@ -74132,6 +80984,13 @@ [ + [[link asio.reference.basic_socket_acceptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -74167,20 +81026,6 @@ [ - [[link asio.reference.basic_socket_acceptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ] - - ] - - [ - - [[link asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]] [The protocol type. ] @@ -74235,6 +81080,13 @@ ] + [ + + [[link asio.reference.basic_socket_acceptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -74289,8 +81141,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -74319,11 +81176,6 @@ ] [ - [[link asio.reference.basic_socket_acceptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native acceptor representation. ] - ] - - [ [[link asio.reference.basic_socket_acceptor.native_handle [*native_handle]]] [Get the native acceptor representation. ] ] @@ -74408,22 +81260,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_socket_acceptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_socket_acceptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections. @@ -74643,13 +81479,20 @@ [ - [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [[link asio.reference.basic_socket_iostream.duration [*duration]]] [The duration type. ] ] [ + [[link asio.reference.basic_socket_iostream.duration_type [*duration_type]]] + [(Deprecated: Use duration.) The duration type. ] + + ] + + [ + [[link asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]] [The endpoint type. ] @@ -74657,11 +81500,18 @@ [ - [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [[link asio.reference.basic_socket_iostream.time_point [*time_point]]] [The time type. ] ] + [ + + [[link asio.reference.basic_socket_iostream.time_type [*time_type]]] + [(Deprecated: Use time_point.) The time type. ] + + ] + ] [heading Member Functions] @@ -74691,17 +81541,27 @@ ] [ + [[link asio.reference.basic_socket_iostream.expires_after [*expires_after]]] + [Set the stream's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_socket_iostream.expires_at [*expires_at]]] - [Get the stream's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the stream's expiry time as an absolute time. Set the stream's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the stream's expiry time relative to now. - Set the stream's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the stream's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_socket_iostream.expiry [*expiry]]] + [Get the stream's expiry time as an absolute time. ] ] [ @@ -74794,6 +81654,13 @@ [ + [[link asio.reference.basic_stream_socket.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_stream_socket.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -74836,20 +81703,6 @@ [ - [[link asio.reference.basic_stream_socket.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a socket. ] - - ] - - [ - - [[link asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.basic_stream_socket.protocol_type [*protocol_type]]] [The protocol type. ] @@ -74904,6 +81757,13 @@ ] + [ + + [[link asio.reference.basic_stream_socket.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -74936,6 +81796,11 @@ ] [ + [[link asio.reference.basic_stream_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 asio.reference.basic_stream_socket.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -74986,8 +81851,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -75018,11 +81888,6 @@ ] [ - [[link asio.reference.basic_stream_socket.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket representation. ] - ] - - [ [[link asio.reference.basic_stream_socket.native_handle [*native_handle]]] [Get the native socket representation. ] ] @@ -75086,6 +81951,11 @@ ] [ + [[link asio.reference.basic_stream_socket.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.basic_stream_socket.write_some [*write_some]]] [Write some data to the socket. ] ] @@ -75139,22 +82009,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_stream_socket.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_stream_socket.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality. @@ -75195,6 +82049,151 @@ [endsect] +[section:make_work make_work] + +[indexterm1 make_work] +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename ``[link asio.reference.Executor Executor]``> + executor_work< Executor > ``[link asio.reference.make_work.overload1 make_work]``( + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.make_work.overload1 more...]]`` + + template< + typename ExecutionContext> + executor_work< typename ExecutionContext::executor_type > ``[link asio.reference.make_work.overload2 make_work]``( + ExecutionContext & ctx, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.make_work.overload2 more...]]`` + + template< + typename T> + executor_work< typename associated_executor< T >::type > ``[link asio.reference.make_work.overload3 make_work]``( + const T & t, + typename enable_if<!is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.make_work.overload3 more...]]`` + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + executor_work< typename associated_executor< T, Executor >::type > ``[link asio.reference.make_work.overload4 make_work]``( + const T & t, + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.make_work.overload4 more...]]`` + + template< + typename T, + typename ExecutionContext> + executor_work< typename associated_executor< T, typename ExecutionContext::executor_type >::type > ``[link asio.reference.make_work.overload5 make_work]``( + const T & t, + ExecutionContext & ctx); + `` [''''»''' [link asio.reference.make_work.overload5 more...]]`` + +[heading Requirements] + +['Header: ][^asio/executor_work.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 make_work (1 of 5 overloads)] + + +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename ``[link asio.reference.Executor Executor]``> + executor_work< Executor > make_work( + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + + + +[endsect] + + + +[section:overload2 make_work (2 of 5 overloads)] + + +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename ExecutionContext> + executor_work< typename ExecutionContext::executor_type > make_work( + ExecutionContext & ctx, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[endsect] + + + +[section:overload3 make_work (3 of 5 overloads)] + + +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename T> + executor_work< typename associated_executor< T >::type > make_work( + const T & t, + typename enable_if<!is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type * = 0); + + + +[endsect] + + + +[section:overload4 make_work (4 of 5 overloads)] + + +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + executor_work< typename associated_executor< T, Executor >::type > make_work( + const T & t, + const Executor & ex, + typename enable_if< is_executor< Executor >::value >::type * = 0); + + + +[endsect] + + + +[section:overload5 make_work (5 of 5 overloads)] + + +Create an [link asio.reference.executor_work `executor_work`] object. + + + template< + typename T, + typename ExecutionContext> + executor_work< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work( + const T & t, + ExecutionContext & ctx); + + + +[endsect] + + +[endsect] + [section:mutable_buffer mutable_buffer] @@ -75655,7 +82654,7 @@ [section:null_buffers null_buffers] -An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence. +(Deprecated: Use the socket/descriptor wait() and async\_wait() member functions.) An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence. class null_buffers @@ -75845,6 +82844,390 @@ [endsect] +[section:package package] + +[indexterm1 package] +Wrap a function object in a packaged task. + + + template< + typename Function> + packaged_token< typename decay< Function >::type, std::allocator< void > > ``[link asio.reference.package.overload1 package]``( + Function function); + `` [''''»''' [link asio.reference.package.overload1 more...]]`` + + template< + typename Function, + typename Allocator> + packaged_token< typename decay< Function >::type, Allocator > ``[link asio.reference.package.overload2 package]``( + Function function, + const Allocator & a); + `` [''''»''' [link asio.reference.package.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^asio/package.hpp] + +['Convenience header: ]None + + +[section:overload1 package (1 of 2 overloads)] + + +Wrap a function object in a packaged task. + + + template< + typename Function> + packaged_token< typename decay< Function >::type, std::allocator< void > > package( + Function function); + + +The `package` function is used to adapt a function object as a packaged task. When this adapter is passed as a completion token to an asynchronous operation, the result of the function object is retuned via a std::future. + + +[heading Example] + + + + + + std::future<std::size_t> fut = + my_socket.async_read_some(buffer, + package([](asio::error_code ec, std::size_t n) + { + return ec ? 0 : n; + })); + ... + std::size_t n = fut.get(); + + + + + +[endsect] + + + +[section:overload2 package (2 of 2 overloads)] + + +Wrap a function object in a packaged task. + + + template< + typename Function, + typename Allocator> + packaged_token< typename decay< Function >::type, Allocator > package( + Function function, + const Allocator & a); + + +The `package` function is used to adapt a function object as a packaged task. When this adapter is passed as a completion token to an asynchronous operation, the result of the function object is retuned via a std::future. + + +[heading Example] + + + + + + std::future<std::size_t> fut = + my_socket.async_read_some(buffer, + package([](asio::error_code ec, std::size_t n) + { + return ec ? 0 : n; + })); + ... + std::size_t n = fut.get(); + + + + + +[endsect] + + +[endsect] + +[section:packaged_handler packaged_handler] + + +A packaged\_task with an associated allocator. + + + template< + typename Signature, + typename Allocator> + class packaged_handler + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.packaged_handler.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.packaged_handler.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link asio.reference.packaged_handler.packaged_handler [*packaged_handler]]] + [Construct from a packaged token. + + Move construct from another packaged handler. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/package.hpp] + +['Convenience header: ]None + + +[section:allocator_type packaged_handler::allocator_type] + +[indexterm2 allocator_type..packaged_handler] +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: ][^asio/package.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:get_allocator packaged_handler::get_allocator] + +[indexterm2 get_allocator..packaged_handler] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + +[section:packaged_handler packaged_handler::packaged_handler] + +[indexterm2 packaged_handler..packaged_handler] +Construct from a packaged token. + + + template< + typename Function> + ``[link asio.reference.packaged_handler.packaged_handler.overload1 packaged_handler]``( + packaged_token< Function, Allocator > && token); + `` [''''»''' [link asio.reference.packaged_handler.packaged_handler.overload1 more...]]`` + + +Move construct from another packaged handler. + + + ``[link asio.reference.packaged_handler.packaged_handler.overload2 packaged_handler]``( + packaged_handler && other); + `` [''''»''' [link asio.reference.packaged_handler.packaged_handler.overload2 more...]]`` + + +[section:overload1 packaged_handler::packaged_handler (1 of 2 overloads)] + + +Construct from a packaged token. + + + template< + typename Function> + packaged_handler( + packaged_token< Function, Allocator > && token); + + + +[endsect] + + + +[section:overload2 packaged_handler::packaged_handler (2 of 2 overloads)] + + +Move construct from another packaged handler. + + + packaged_handler( + packaged_handler && other); + + + +[endsect] + + +[endsect] + + +[endsect] + +[section:packaged_token packaged_token] + + +Class to enable lazy construction of a packaged\_task from a completion token. + + + template< + typename Function, + typename Allocator = std::allocator<void>> + class packaged_token + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.packaged_token.allocator_type [*allocator_type]]] + [The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.packaged_token.get_allocator [*get_allocator]]] + [Obtain allocator. ] + ] + + [ + [[link asio.reference.packaged_token.packaged_token [*packaged_token]]] + [Construct using specified allocator. ] + ] + +] + +The [link asio.reference.packaged_token `packaged_token`] class is used to adapt a function object as a packaged task. When this adapter is passed as a completion token to an asynchronous operation, the result of the function object is retuned via a std::future. + +Use the [link asio.reference.package `package`] function rather than using this class directly. + +[heading Requirements] + +['Header: ][^asio/package.hpp] + +['Convenience header: ]None + + +[section:allocator_type packaged_token::allocator_type] + +[indexterm2 allocator_type..packaged_token] +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: ][^asio/package.hpp] + +['Convenience header: ]None + + +[endsect] + + + +[section:get_allocator packaged_token::get_allocator] + +[indexterm2 get_allocator..packaged_token] +Obtain allocator. + + + allocator_type get_allocator() const; + + + +[endsect] + + +[section:packaged_token packaged_token::packaged_token] + +[indexterm2 packaged_token..packaged_token] +Construct using specified allocator. + + + explicit ``[link asio.reference.packaged_token.packaged_token.overload1 packaged_token]``( + Function f); + `` [''''»''' [link asio.reference.packaged_token.packaged_token.overload1 more...]]`` + + ``[link asio.reference.packaged_token.packaged_token.overload2 packaged_token]``( + Function f, + const Allocator & allocator); + `` [''''»''' [link asio.reference.packaged_token.packaged_token.overload2 more...]]`` + + +[section:overload1 packaged_token::packaged_token (1 of 2 overloads)] + + +Construct using specified allocator. + + + packaged_token( + Function f); + + + +[endsect] + + + +[section:overload2 packaged_token::packaged_token (2 of 2 overloads)] + + +Construct using specified allocator. + + + packaged_token( + Function f, + const Allocator & allocator); + + + +[endsect] + + +[endsect] + + +[endsect] + [section:placeholders__bytes_transferred placeholders::bytes_transferred] @@ -75951,6 +83334,13 @@ [ + [[link asio.reference.posix__basic_descriptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -75972,25 +83362,18 @@ [ - [[link asio.reference.posix__basic_descriptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ] - - ] - - [ - - [[link asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] - - ] - - [ - [[link asio.reference.posix__basic_descriptor.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] ] + [ + + [[link asio.reference.posix__basic_descriptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -76003,6 +83386,11 @@ ] [ + [[link asio.reference.posix__basic_descriptor.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]] [Construct a basic_descriptor without opening it. @@ -76022,8 +83410,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -76044,11 +83437,6 @@ ] [ - [[link asio.reference.posix__basic_descriptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor representation. ] - ] - - [ [[link asio.reference.posix__basic_descriptor.native_handle [*native_handle]]] [Get the native descriptor representation. ] ] @@ -76077,6 +83465,11 @@ [Release ownership of the native descriptor implementation. ] ] + [ + [[link asio.reference.posix__basic_descriptor.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -76100,22 +83493,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.posix__basic_descriptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.posix__basic_descriptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor. @@ -76181,6 +83558,70 @@ [endsect] + +[section:async_wait posix::basic_descriptor::async_wait] + +[indexterm2 async_wait..posix::basic_descriptor] +Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::posix::stream_descriptor descriptor(io_service); + ... + descriptor.async_wait( + asio::posix::stream_descriptor::wait_read, + wait_handler); + + + + + + + +[endsect] + + [section:basic_descriptor posix::basic_descriptor::basic_descriptor] [indexterm2 basic_descriptor..posix::basic_descriptor] @@ -76502,6 +83943,104 @@ [endsect] + +[section:executor_type posix::basic_descriptor::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..posix::basic_descriptor] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/posix/basic_descriptor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor posix::basic_descriptor::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..posix::basic_descriptor] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation posix::basic_descriptor::get_implementation] [indexterm2 get_implementation..posix::basic_descriptor] @@ -76557,7 +84096,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..posix::basic_descriptor] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -76625,23 +84164,6 @@ [endsect] -[section:implementation posix::basic_descriptor::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..posix::basic_descriptor] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type posix::basic_descriptor::implementation_type] @@ -76897,6 +84419,13 @@ [ + [[link asio.reference.posix__basic_descriptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -76918,25 +84447,18 @@ [ - [[link asio.reference.posix__basic_descriptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ] - - ] - - [ - - [[link asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] - - ] - - [ - [[link asio.reference.posix__basic_descriptor.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] ] + [ + + [[link asio.reference.posix__basic_descriptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -76949,6 +84471,11 @@ ] [ + [[link asio.reference.posix__basic_descriptor.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]] [Construct a basic_descriptor without opening it. @@ -76968,8 +84495,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -76990,11 +84522,6 @@ ] [ - [[link asio.reference.posix__basic_descriptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor representation. ] - ] - - [ [[link asio.reference.posix__basic_descriptor.native_handle [*native_handle]]] [Get the native descriptor representation. ] ] @@ -77023,6 +84550,11 @@ [Release ownership of the native descriptor implementation. ] ] + [ + [[link asio.reference.posix__basic_descriptor.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -77046,22 +84578,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.posix__basic_descriptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.posix__basic_descriptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor. @@ -77085,22 +84601,6 @@ -[section:native posix::basic_descriptor::native] - -[indexterm2 native..posix::basic_descriptor] -(Deprecated: Use `native_handle()`.) Get the native descriptor representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle posix::basic_descriptor::native_handle] [indexterm2 native_handle..posix::basic_descriptor] @@ -77260,27 +84760,6 @@ [endsect] - -[section:native_type posix::basic_descriptor::native_type] - -[indexterm2 native_type..posix::basic_descriptor] -(Deprecated: Use native\_handle\_type.) The native representation of a descriptor. - - - typedef DescriptorService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/posix/basic_descriptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking posix::basic_descriptor::non_blocking] [indexterm2 non_blocking..posix::basic_descriptor] @@ -77409,48 +84888,6 @@ [endsect] -[section:non_blocking_io posix::basic_descriptor::non_blocking_io] - - -['Inherited from posix::descriptor_base.] - -[indexterm2 non_blocking_io..posix::basic_descriptor] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::posix::stream_descriptor descriptor(io_service); - ... - asio::descriptor_base::non_blocking_io command(true); - descriptor.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/posix/basic_descriptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ posix::basic_descriptor::operator=] [indexterm2 operator=..posix::basic_descriptor] @@ -77503,30 +84940,6 @@ -[section:service posix::basic_descriptor::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..posix::basic_descriptor] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type posix::basic_descriptor::service_type] @@ -77550,6 +84963,152 @@ [endsect] +[section:wait posix::basic_descriptor::wait] + +[indexterm2 wait..posix::basic_descriptor] +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.posix__basic_descriptor.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.posix__basic_descriptor.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.posix__basic_descriptor.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.posix__basic_descriptor.wait.overload2 more...]]`` + + +[section:overload1 posix::basic_descriptor::wait (1 of 2 overloads)] + + +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +] + + +[heading Example] + +Waiting for a descriptor to become readable. + + asio::posix::stream_descriptor descriptor(io_service); + ... + descriptor.wait(asio::posix::stream_descriptor::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 posix::basic_descriptor::wait (2 of 2 overloads)] + + +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a descriptor to become readable. + + asio::posix::stream_descriptor descriptor(io_service); + ... + asio::error_code ec; + descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type posix::basic_descriptor::wait_type] + + +['Inherited from posix::descriptor_base.] + +[indexterm2 wait_type..posix::basic_descriptor] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..posix::basic_descriptor] +[indexterm2 wait_write..posix::basic_descriptor] +[indexterm2 wait_error..posix::basic_descriptor] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a descriptor to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a descriptor to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a descriptor to have error conditions pending. ] + ] + +] + + +For use with `basic_descriptor::wait()` and `basic_descriptor::async_wait()`. + + +[endsect] + + [section:_basic_descriptor posix::basic_descriptor::~basic_descriptor] @@ -77592,6 +85151,13 @@ [ + [[link asio.reference.posix__basic_stream_descriptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -77613,25 +85179,18 @@ [ - [[link asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ] - - ] - - [ - - [[link asio.reference.posix__basic_stream_descriptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] - - ] - - [ - [[link asio.reference.posix__basic_stream_descriptor.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] ] + [ + + [[link asio.reference.posix__basic_stream_descriptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -77649,6 +85208,11 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -77673,8 +85237,13 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -77695,11 +85264,6 @@ ] [ - [[link asio.reference.posix__basic_stream_descriptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor representation. ] - ] - - [ [[link asio.reference.posix__basic_stream_descriptor.native_handle [*native_handle]]] [Get the native descriptor representation. ] ] @@ -77734,6 +85298,11 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]] [Write some data to the descriptor. ] ] @@ -77756,22 +85325,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.posix__basic_stream_descriptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template provides asynchronous and blocking stream-oriented descriptor functionality. @@ -77902,6 +85455,73 @@ +[section:async_wait posix::basic_stream_descriptor::async_wait] + + +['Inherited from posix::basic_descriptor.] + +[indexterm2 async_wait..posix::basic_stream_descriptor] +Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + wait_type w, + WaitHandler handler); + + +This function is used to perform an asynchronous wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +[[handler][The handler to be called when the wait operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + const asio::error_code& error // Result of operation + ); +`` +Regardless of whether the asynchronous operation completes 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 `asio::io_service::post()`.]] + +] + + +[heading Example] + + + + void wait_handler(const asio::error_code& error) + { + if (!error) + { + // Wait succeeded. + } + } + + ... + + asio::posix::stream_descriptor descriptor(io_service); + ... + descriptor.async_wait( + asio::posix::stream_descriptor::wait_read, + wait_handler); + + + + + + + +[endsect] + + + [section:async_write_some posix::basic_stream_descriptor::async_write_some] [indexterm2 async_write_some..posix::basic_stream_descriptor] @@ -78291,6 +85911,104 @@ [endsect] + +[section:executor_type posix::basic_stream_descriptor::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..posix::basic_stream_descriptor] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/posix/basic_stream_descriptor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor posix::basic_stream_descriptor::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..posix::basic_stream_descriptor] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation posix::basic_stream_descriptor::get_implementation] [indexterm2 get_implementation..posix::basic_stream_descriptor] @@ -78346,7 +86064,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..posix::basic_stream_descriptor] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -78414,23 +86132,6 @@ [endsect] -[section:implementation posix::basic_stream_descriptor::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..posix::basic_stream_descriptor] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type posix::basic_stream_descriptor::implementation_type] @@ -78700,6 +86401,13 @@ [ + [[link asio.reference.posix__basic_descriptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -78721,25 +86429,18 @@ [ - [[link asio.reference.posix__basic_descriptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ] - - ] - - [ - - [[link asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] - - ] - - [ - [[link asio.reference.posix__basic_descriptor.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] ] + [ + + [[link asio.reference.posix__basic_descriptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -78752,6 +86453,11 @@ ] [ + [[link asio.reference.posix__basic_descriptor.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]] [Construct a basic_descriptor without opening it. @@ -78771,8 +86477,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -78793,11 +86504,6 @@ ] [ - [[link asio.reference.posix__basic_descriptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor representation. ] - ] - - [ [[link asio.reference.posix__basic_descriptor.native_handle [*native_handle]]] [Get the native descriptor representation. ] ] @@ -78826,6 +86532,11 @@ [Release ownership of the native descriptor implementation. ] ] + [ + [[link asio.reference.posix__basic_descriptor.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Protected Member Functions] @@ -78849,22 +86560,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.posix__basic_descriptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.posix__basic_descriptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor. @@ -78888,25 +86583,6 @@ -[section:native posix::basic_stream_descriptor::native] - - -['Inherited from posix::basic_descriptor.] - -[indexterm2 native..posix::basic_stream_descriptor] -(Deprecated: Use `native_handle()`.) Get the native descriptor representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle posix::basic_stream_descriptor::native_handle] @@ -79078,27 +86754,6 @@ [endsect] - -[section:native_type posix::basic_stream_descriptor::native_type] - -[indexterm2 native_type..posix::basic_stream_descriptor] -(Deprecated: Use native\_handle\_type.) The native representation of a descriptor. - - - typedef StreamDescriptorService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/posix/basic_stream_descriptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking posix::basic_stream_descriptor::non_blocking] [indexterm2 non_blocking..posix::basic_stream_descriptor] @@ -79236,48 +86891,6 @@ [endsect] -[section:non_blocking_io posix::basic_stream_descriptor::non_blocking_io] - - -['Inherited from posix::descriptor_base.] - -[indexterm2 non_blocking_io..posix::basic_stream_descriptor] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::posix::stream_descriptor descriptor(io_service); - ... - asio::descriptor_base::non_blocking_io command(true); - descriptor.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/posix/basic_stream_descriptor.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ posix::basic_stream_descriptor::operator=] [indexterm2 operator=..posix::basic_stream_descriptor] @@ -79459,30 +87072,6 @@ -[section:service posix::basic_stream_descriptor::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..posix::basic_stream_descriptor] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type posix::basic_stream_descriptor::service_type] @@ -79506,6 +87095,158 @@ [endsect] +[section:wait posix::basic_stream_descriptor::wait] + +[indexterm2 wait..posix::basic_stream_descriptor] +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + void ``[link asio.reference.posix__basic_stream_descriptor.wait.overload1 wait]``( + wait_type w); + `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.wait.overload1 more...]]`` + + asio::error_code ``[link asio.reference.posix__basic_stream_descriptor.wait.overload2 wait]``( + wait_type w, + asio::error_code & ec); + `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.wait.overload2 more...]]`` + + +[section:overload1 posix::basic_stream_descriptor::wait (1 of 2 overloads)] + + +['Inherited from posix::basic_descriptor.] + + +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + void wait( + wait_type w); + + +This function is used to perform a blocking wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +] + + +[heading Example] + +Waiting for a descriptor to become readable. + + asio::posix::stream_descriptor descriptor(io_service); + ... + descriptor.wait(asio::posix::stream_descriptor::wait_read); + + + + + + + +[endsect] + + + +[section:overload2 posix::basic_stream_descriptor::wait (2 of 2 overloads)] + + +['Inherited from posix::basic_descriptor.] + + +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + wait_type w, + asio::error_code & ec); + + +This function is used to perform a blocking wait for a descriptor to enter a ready to read, write or error condition state. + + +[heading Parameters] + + +[variablelist + +[[w][Specifies the desired descriptor state.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Example] + +Waiting for a descriptor to become readable. + + asio::posix::stream_descriptor descriptor(io_service); + ... + asio::error_code ec; + descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); + + + + + + + +[endsect] + + +[endsect] + + +[section:wait_type posix::basic_stream_descriptor::wait_type] + + +['Inherited from posix::descriptor_base.] + +[indexterm2 wait_type..posix::basic_stream_descriptor] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..posix::basic_stream_descriptor] +[indexterm2 wait_write..posix::basic_stream_descriptor] +[indexterm2 wait_error..posix::basic_stream_descriptor] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a descriptor to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a descriptor to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a descriptor to have error conditions pending. ] + ] + +] + + +For use with `basic_descriptor::wait()` and `basic_descriptor::async_wait()`. + + +[endsect] + + [section:write_some posix::basic_stream_descriptor::write_some] [indexterm2 write_some..posix::basic_stream_descriptor] @@ -79657,8 +87398,8 @@ [ - [[link asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] + [[link asio.reference.posix__descriptor_base.wait_type [*wait_type]]] + [Wait types. ] ] @@ -79722,39 +87463,40 @@ -[section:non_blocking_io posix::descriptor_base::non_blocking_io] +[section:wait_type posix::descriptor_base::wait_type] -[indexterm2 non_blocking_io..posix::descriptor_base] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor. +[indexterm2 wait_type..posix::descriptor_base] +Wait types. - typedef implementation_defined non_blocking_io; + enum wait_type + +[indexterm2 wait_read..posix::descriptor_base] +[indexterm2 wait_write..posix::descriptor_base] +[indexterm2 wait_error..posix::descriptor_base] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a descriptor to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a descriptor to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a descriptor to have error conditions pending. ] + ] + +] - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::posix::stream_descriptor descriptor(io_service); - ... - asio::descriptor_base::non_blocking_io command(true); - descriptor.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/posix/descriptor_base.hpp] - -['Convenience header: ][^asio.hpp] +For use with `basic_descriptor::wait()` and `basic_descriptor::async_wait()`. [endsect] @@ -79800,6 +87542,13 @@ [ + [[link asio.reference.posix__basic_stream_descriptor.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -79821,25 +87570,18 @@ [ - [[link asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ] - - ] - - [ - - [[link asio.reference.posix__basic_stream_descriptor.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ] - - ] - - [ - [[link asio.reference.posix__basic_stream_descriptor.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] ] + [ + + [[link asio.reference.posix__basic_stream_descriptor.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Member Functions] @@ -79857,6 +87599,11 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -79881,8 +87628,13 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -79903,11 +87655,6 @@ ] [ - [[link asio.reference.posix__basic_stream_descriptor.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor representation. ] - ] - - [ [[link asio.reference.posix__basic_stream_descriptor.native_handle [*native_handle]]] [Get the native descriptor representation. ] ] @@ -79942,6 +87689,11 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]] [Write some data to the descriptor. ] ] @@ -79964,22 +87716,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.posix__basic_stream_descriptor.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template provides asynchronous and blocking stream-oriented descriptor functionality. @@ -80031,13 +87767,6 @@ ] - [ - - [[link asio.reference.posix__stream_descriptor_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native descriptor type. ] - - ] - ] [heading Member Functions] @@ -80055,6 +87784,11 @@ ] [ + [[link asio.reference.posix__stream_descriptor_service.async_wait [*async_wait]]] + [Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__stream_descriptor_service.async_write_some [*async_write_some]]] [Start an asynchronous write. ] ] @@ -80105,11 +87839,6 @@ ] [ - [[link asio.reference.posix__stream_descriptor_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native descriptor implementation. ] - ] - - [ [[link asio.reference.posix__stream_descriptor_service.native_handle [*native_handle]]] [Get the native descriptor implementation. ] ] @@ -80144,6 +87873,11 @@ ] [ + [[link asio.reference.posix__stream_descriptor_service.wait [*wait]]] + [Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.posix__stream_descriptor_service.write_some [*write_some]]] [Write the given data to the stream. ] ] @@ -80205,6 +87939,25 @@ +[section:async_wait posix::stream_descriptor_service::async_wait] + +[indexterm2 async_wait..posix::stream_descriptor_service] +Asynchronously wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + implementation_type & impl, + descriptor_base::wait_type w, + WaitHandler handler); + + + +[endsect] + + + [section:async_write_some posix::stream_descriptor_service::async_write_some] [indexterm2 async_write_some..posix::stream_descriptor_service] @@ -80406,21 +88159,6 @@ -[section:native posix::stream_descriptor_service::native] - -[indexterm2 native..posix::stream_descriptor_service] -(Deprecated: Use `native_handle()`.) Get the native descriptor implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle posix::stream_descriptor_service::native_handle] [indexterm2 native_handle..posix::stream_descriptor_service] @@ -80510,27 +88248,6 @@ [endsect] - -[section:native_type posix::stream_descriptor_service::native_type] - -[indexterm2 native_type..posix::stream_descriptor_service] -(Deprecated: Use native\_handle\_type.) The native descriptor type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/posix/stream_descriptor_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking posix::stream_descriptor_service::non_blocking] [indexterm2 non_blocking..posix::stream_descriptor_service] @@ -80635,6 +88352,23 @@ +[section:wait posix::stream_descriptor_service::wait] + +[indexterm2 wait..posix::stream_descriptor_service] +Wait for the descriptor to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + implementation_type & impl, + descriptor_base::wait_type w, + asio::error_code & ec); + + + +[endsect] + + + [section:write_some posix::stream_descriptor_service::write_some] [indexterm2 write_some..posix::stream_descriptor_service] @@ -80656,6 +88390,162 @@ [endsect] +[section:post post] + +[indexterm1 post] +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.post.overload1 post]``( + CompletionToken token); + `` [''''»''' [link asio.reference.post.overload1 more...]]`` + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.post.overload2 post]``( + const Executor & ex, + CompletionToken token, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.post.overload2 more...]]`` + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.post.overload3 post]``( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.post.overload3 more...]]`` + +[heading Requirements] + +['Header: ][^asio/post.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 post (1 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` post( + CompletionToken token); + + +This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex` by performing `get_associated_executor(handler)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Performs `ex.post(std::move(handler), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload2 post (2 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` post( + const Executor & ex, + CompletionToken token, + typename enable_if< 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()`. + +This function has the following effects: + + +* Constructs a function object handler of type `Handler`, initialized with `handler(forward<CompletionToken>(token))`. + + +* Constructs an object `result` of type `async_result<Handler>`, initializing the object as `result(handler)`. + + +* Obtains the handler's associated executor object `ex1` by performing `get_associated_executor(handler)`. + + +* Creates a work object `w` by performing `make_work(ex1)`. + + +* Obtains the handler's associated allocator object `alloc` by performing `get_associated_allocator(handler)`. + + +* Constructs a function object `f` with a function call operator that performs `ex1.dispatch(std::move(handler), alloc)` followed by `w.reset()`. + + +* Performs `Executor(ex).post(std::move(f), alloc)`. + + +* Returns `result.get()`. + + + + +[endsect] + + + +[section:overload3 post (3 of 3 overloads)] + + +Submits a completion token or function object for execution. + + + template< + typename ExecutionContext, + typename CompletionToken> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` post( + ExecutionContext & ctx, + CompletionToken token, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[heading Return Value] + +`post(ctx.get_executor(), forward<CompletionToken>(token))`. + + + + +[endsect] + + +[endsect] + [section:raw_socket_service raw_socket_service] @@ -80695,13 +88585,6 @@ [ - [[link asio.reference.raw_socket_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native socket type. ] - - ] - - [ - [[link asio.reference.raw_socket_service.protocol_type [*protocol_type]]] [The protocol type. ] @@ -80744,6 +88627,11 @@ ] [ + [[link asio.reference.raw_socket_service.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.raw_socket_service.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -80824,11 +88712,6 @@ ] [ - [[link asio.reference.raw_socket_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket implementation. ] - ] - - [ [[link asio.reference.raw_socket_service.native_handle [*native_handle]]] [Get the native socket implementation. ] ] @@ -80892,6 +88775,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.raw_socket_service.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Data Members] @@ -81035,6 +88923,25 @@ +[section:async_wait raw_socket_service::async_wait] + +[indexterm2 async_wait..raw_socket_service] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + implementation_type & impl, + socket_base::wait_type w, + WaitHandler handler); + + + +[endsect] + + + [section:at_mark raw_socket_service::at_mark] [indexterm2 at_mark..raw_socket_service] @@ -81355,21 +89262,6 @@ -[section:native raw_socket_service::native] - -[indexterm2 native..raw_socket_service] -(Deprecated: Use `native_handle()`.) Get the native socket implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle raw_socket_service::native_handle] [indexterm2 native_handle..raw_socket_service] @@ -81459,27 +89351,6 @@ [endsect] - -[section:native_type raw_socket_service::native_type] - -[indexterm2 native_type..raw_socket_service] -(Deprecated: Use native\_handle\_type.) The native socket type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/raw_socket_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking raw_socket_service::non_blocking] [indexterm2 non_blocking..raw_socket_service] @@ -81720,6 +89591,23 @@ +[section:wait raw_socket_service::wait] + +[indexterm2 wait..raw_socket_service] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + implementation_type & impl, + socket_base::wait_type w, + asio::error_code & ec); + + + +[endsect] + + + [endsect] [section:read read] @@ -83864,13 +91752,6 @@ [ - [[link asio.reference.seq_packet_socket_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native socket type. ] - - ] - - [ - [[link asio.reference.seq_packet_socket_service.protocol_type [*protocol_type]]] [The protocol type. ] @@ -83903,6 +91784,11 @@ ] [ + [[link asio.reference.seq_packet_socket_service.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.seq_packet_socket_service.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -83983,11 +91869,6 @@ ] [ - [[link asio.reference.seq_packet_socket_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket implementation. ] - ] - - [ [[link asio.reference.seq_packet_socket_service.native_handle [*native_handle]]] [Get the native socket implementation. ] ] @@ -84041,6 +91922,11 @@ [Disable sends or receives on the socket. ] ] + [ + [[link asio.reference.seq_packet_socket_service.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Data Members] @@ -84141,6 +92027,25 @@ +[section:async_wait seq_packet_socket_service::async_wait] + +[indexterm2 async_wait..seq_packet_socket_service] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + implementation_type & impl, + socket_base::wait_type w, + WaitHandler handler); + + + +[endsect] + + + [section:at_mark seq_packet_socket_service::at_mark] [indexterm2 at_mark..seq_packet_socket_service] @@ -84463,21 +92368,6 @@ -[section:native seq_packet_socket_service::native] - -[indexterm2 native..seq_packet_socket_service] -(Deprecated: Use `native_handle()`.) Get the native socket implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle seq_packet_socket_service::native_handle] [indexterm2 native_handle..seq_packet_socket_service] @@ -84567,27 +92457,6 @@ [endsect] - -[section:native_type seq_packet_socket_service::native_type] - -[indexterm2 native_type..seq_packet_socket_service] -(Deprecated: Use native\_handle\_type.) The native socket type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/seq_packet_socket_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking seq_packet_socket_service::non_blocking] [indexterm2 non_blocking..seq_packet_socket_service] @@ -84789,6 +92658,23 @@ +[section:wait seq_packet_socket_service::wait] + +[indexterm2 wait..seq_packet_socket_service] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + implementation_type & impl, + socket_base::wait_type w, + asio::error_code & ec); + + + +[endsect] + + + [endsect] @@ -84807,6 +92693,13 @@ [ + [[link asio.reference.basic_serial_port.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_serial_port.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -84828,13 +92721,6 @@ [ - [[link asio.reference.basic_serial_port.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a serial port. ] - - ] - - [ - [[link asio.reference.basic_serial_port.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -84883,8 +92769,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -84905,11 +92796,6 @@ ] [ - [[link asio.reference.basic_serial_port.native [*native]]] - [(Deprecated: Use native_handle().) Get the native serial port representation. ] - ] - - [ [[link asio.reference.basic_serial_port.native_handle [*native_handle]]] [Get the native serial port representation. ] ] @@ -84962,22 +92848,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_serial_port.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_serial_port.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports. @@ -85754,13 +93624,6 @@ ] - [ - - [[link asio.reference.serial_port_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native handle type. ] - - ] - ] [heading Member Functions] @@ -85828,11 +93691,6 @@ ] [ - [[link asio.reference.serial_port_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle implementation. ] - ] - - [ [[link asio.reference.serial_port_service.native_handle [*native_handle]]] [Get the native handle implementation. ] ] @@ -86125,21 +93983,6 @@ -[section:native serial_port_service::native] - -[indexterm2 native..serial_port_service] -(Deprecated: Use `native_handle()`.) Get the native handle implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle serial_port_service::native_handle] [indexterm2 native_handle..serial_port_service] @@ -86176,27 +94019,6 @@ -[section:native_type serial_port_service::native_type] - -[indexterm2 native_type..serial_port_service] -(Deprecated: Use native\_handle\_type.) The native handle type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/serial_port_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:open serial_port_service::open] [indexterm2 open..serial_port_service] @@ -86307,7 +94129,7 @@ [section:service_already_exists service_already_exists] -Exception thrown when trying to add a duplicate service to an [link asio.reference.io_service `io_service`]. +Exception thrown when trying to add a duplicate service to an [link asio.reference.execution_context `execution_context`]. class service_already_exists @@ -86326,7 +94148,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/execution_context.hpp] ['Convenience header: ][^asio.hpp] @@ -86361,6 +94183,13 @@ [ + [[link asio.reference.basic_signal_set.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_signal_set.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -86411,8 +94240,13 @@ ] [ + [[link asio.reference.basic_signal_set.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.basic_signal_set.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -86438,22 +94272,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_signal_set.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_signal_set.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_signal_set `basic_signal_set`] class template provides the ability to perform an asynchronous wait for one or more signals to occur. Most applications will use the [link asio.reference.signal_set `signal_set`] typedef. @@ -86839,13 +94657,6 @@ [ - [[link asio.reference.socket_acceptor_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native acceptor type. ] - - ] - - [ - [[link asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]] [The protocol type. ] @@ -86943,11 +94754,6 @@ ] [ - [[link asio.reference.socket_acceptor_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native acceptor implementation. ] - ] - - [ [[link asio.reference.socket_acceptor_service.native_handle [*native_handle]]] [Get the native acceptor implementation. ] ] @@ -87354,21 +95160,6 @@ -[section:native socket_acceptor_service::native] - -[indexterm2 native..socket_acceptor_service] -(Deprecated: Use `native_handle()`.) Get the native acceptor implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle socket_acceptor_service::native_handle] [indexterm2 native_handle..socket_acceptor_service] @@ -87458,27 +95249,6 @@ [endsect] - -[section:native_type socket_acceptor_service::native_type] - -[indexterm2 native_type..socket_acceptor_service] -(Deprecated: Use native\_handle\_type.) The native acceptor type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/socket_acceptor_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking socket_acceptor_service::non_blocking] [indexterm2 non_blocking..socket_acceptor_service] @@ -87679,13 +95449,6 @@ [ - [[link asio.reference.socket_base.non_blocking_io [*non_blocking_io]]] - [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ] - - ] - - [ - [[link asio.reference.socket_base.receive_buffer_size [*receive_buffer_size]]] [Socket option for the receive buffer size of a socket. ] @@ -87726,6 +95489,13 @@ ] + [ + + [[link asio.reference.socket_base.wait_type [*wait_type]]] + [Wait types. ] + + ] + ] [heading Protected Member Functions] @@ -88215,45 +95985,6 @@ -[section:non_blocking_io socket_base::non_blocking_io] - -[indexterm2 non_blocking_io..socket_base] -(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket. - - - typedef implementation_defined non_blocking_io; - - - -Implements the FIONBIO IO control command. - - -[heading Example] - - - - asio::ip::tcp::socket socket(io_service); - ... - asio::socket_base::non_blocking_io command(true); - socket.io_control(command); - - - - - - - -[heading Requirements] - -['Header: ][^asio/socket_base.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:receive_buffer_size socket_base::receive_buffer_size] [indexterm2 receive_buffer_size..socket_base] @@ -88547,6 +96278,46 @@ +[section:wait_type socket_base::wait_type] + +[indexterm2 wait_type..socket_base] +Wait types. + + + enum wait_type + +[indexterm2 wait_read..socket_base] +[indexterm2 wait_write..socket_base] +[indexterm2 wait_error..socket_base] + +[heading Values] +[variablelist + + [ + [wait_read] + [Wait for a socket to become ready to read. ] + ] + + [ + [wait_write] + [Wait for a socket to become ready to write. ] + ] + + [ + [wait_error] + [Wait for a socket to have error conditions pending. ] + ] + +] + + +For use with `basic_socket::wait()` and `basic_socket::async_wait()`. + + +[endsect] + + + [section:_socket_base socket_base::~socket_base] [indexterm2 ~socket_base..socket_base] @@ -88575,7 +96346,8 @@ void ``[link asio.reference.spawn.overload1 spawn]``( Handler handler, Function function, - const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if<!is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type * = 0); `` [''''»''' [link asio.reference.spawn.overload1 more...]]`` template< @@ -88588,21 +96360,42 @@ `` [''''»''' [link asio.reference.spawn.overload2 more...]]`` template< - typename Function> + typename Function, + typename ``[link asio.reference.Executor Executor]``> void ``[link asio.reference.spawn.overload3 spawn]``( - asio::io_service::strand strand, + const Executor & ex, Function function, - const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if< is_executor< Executor >::value >::type * = 0); `` [''''»''' [link asio.reference.spawn.overload3 more...]]`` template< - typename Function> + typename Function, + typename ``[link asio.reference.Executor Executor]``> void ``[link asio.reference.spawn.overload4 spawn]``( - asio::io_service & io_service, + const strand< Executor > & ex, Function function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); `` [''''»''' [link asio.reference.spawn.overload4 more...]]`` + template< + typename Function> + void ``[link asio.reference.spawn.overload5 spawn]``( + const asio::io_service::strand & s, + Function function, + const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + `` [''''»''' [link asio.reference.spawn.overload5 more...]]`` + + template< + typename Function, + typename ExecutionContext> + void ``[link asio.reference.spawn.overload6 spawn]``( + ExecutionContext & ctx, + Function function, + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.spawn.overload6 more...]]`` + The `spawn()` function is a high-level wrapper over the Boost.Coroutine library. This function enables programs to implement asynchronous logic in a synchronous manner, as illustrated by the following example: @@ -88639,10 +96432,10 @@ ['Header: ][^asio/spawn.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None -[section:overload1 spawn (1 of 4 overloads)] +[section:overload1 spawn (1 of 6 overloads)] Start a new stackful coroutine, calling the specified handler when it completes. @@ -88654,7 +96447,8 @@ void spawn( Handler handler, Function function, - const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if<!is_executor< typename decay< Handler >::type >::value &&!is_convertible< Handler &, execution_context & >::value >::type * = 0); This function is used to launch a new coroutine. @@ -88688,7 +96482,7 @@ -[section:overload2 spawn (2 of 4 overloads)] +[section:overload2 spawn (2 of 6 overloads)] Start a new stackful coroutine, inheriting the execution context of another. @@ -88730,18 +96524,20 @@ -[section:overload3 spawn (3 of 4 overloads)] +[section:overload3 spawn (3 of 6 overloads)] -Start a new stackful coroutine that executes in the context of a strand. +Start a new stackful coroutine that executes on a given executor. template< - typename Function> + typename Function, + typename ``[link asio.reference.Executor Executor]``> void spawn( - asio::io_service::strand strand, + const Executor & ex, Function function, - const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if< is_executor< Executor >::value >::type * = 0); This function is used to launch a new coroutine. @@ -88752,7 +96548,7 @@ [variablelist -[[strand][Identifies a strand. By starting multiple coroutines on the same strand, the implementation ensures that none of those coroutines can execute simultaneously.]] +[[ex][Identifies the executor that will run the coroutine. The new coroutine is implicitly given its own strand within this executor.]] [[function][The coroutine function. The function must have the signature: `` @@ -88771,16 +96567,17 @@ -[section:overload4 spawn (4 of 4 overloads)] +[section:overload4 spawn (4 of 6 overloads)] -Start a new stackful coroutine that executes on a given [link asio.reference.io_service `io_service`]. +Start a new stackful coroutine that executes on a given strand. template< - typename Function> + typename Function, + typename ``[link asio.reference.Executor Executor]``> void spawn( - asio::io_service & io_service, + const strand< Executor > & ex, Function function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); @@ -88793,7 +96590,91 @@ [variablelist -[[io_service][Identifies the [link asio.reference.io_service `io_service`] that will run the coroutine. The new coroutine is implicitly given its own strand within this [link asio.reference.io_service `io_service`].]] +[[ex][Identifies the strand that will run the coroutine.]] + +[[function][The coroutine function. The function must have the signature: +`` + void function(yield_context yield); +`` +]] + +[[attributes][Boost.Coroutine attributes used to customise the coroutine. ]] + +] + + + + +[endsect] + + + +[section:overload5 spawn (5 of 6 overloads)] + + +Start a new stackful coroutine that executes in the context of a strand. + + + template< + typename Function> + void spawn( + const asio::io_service::strand & s, + Function function, + const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); + + +This function is used to launch a new coroutine. + + +[heading Parameters] + + +[variablelist + +[[s][Identifies a strand. By starting multiple coroutines on the same strand, the implementation ensures that none of those coroutines can execute simultaneously.]] + +[[function][The coroutine function. The function must have the signature: +`` + void function(yield_context yield); +`` +]] + +[[attributes][Boost.Coroutine attributes used to customise the coroutine. ]] + +] + + + + +[endsect] + + + +[section:overload6 spawn (6 of 6 overloads)] + + +Start a new stackful coroutine that executes on a given execution context. + + + template< + typename Function, + typename ExecutionContext> + void spawn( + ExecutionContext & ctx, + Function function, + const boost::coroutines::attributes & attributes = boost::coroutines::attributes(), + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + +This function is used to launch a new coroutine. + + +[heading Parameters] + + +[variablelist + +[[ctx][Identifies the execution context that will run the coroutine. The new coroutine is implicitly given its own strand within this execution context.]] [[function][The coroutine function. The function must have the signature: `` @@ -88835,13 +96716,6 @@ [ - [[link asio.reference.ssl__context.impl_type [*impl_type]]] - [(Deprecated: Use native_handle_type.) The native type of the SSL context. ] - - ] - - [ - [[link asio.reference.ssl__context.method [*method]]] [Different methods supported by a context. ] @@ -88893,17 +96767,10 @@ [[link asio.reference.ssl__context.context [*context]]] [Constructor. - Deprecated constructor taking a reference to an io_service object. - Move-construct a context from another. ] ] [ - [[link asio.reference.ssl__context.impl [*impl]]] - [(Deprecated: Use native_handle().) Get the underlying implementation in the native type. ] - ] - - [ [[link asio.reference.ssl__context.load_verify_file [*load_verify_file]]] [Load a certification authority file for performing verification. ] ] @@ -89352,24 +97219,15 @@ `` [''''»''' [link asio.reference.ssl__context.context.overload1 more...]]`` -Deprecated constructor taking a reference to an [link asio.reference.io_service `io_service`] object. - - - ``[link asio.reference.ssl__context.context.overload2 context]``( - asio::io_service & , - method m); - `` [''''»''' [link asio.reference.ssl__context.context.overload2 more...]]`` - - Move-construct a context from another. - ``[link asio.reference.ssl__context.context.overload3 context]``( + ``[link asio.reference.ssl__context.context.overload2 context]``( context && other); - `` [''''»''' [link asio.reference.ssl__context.context.overload3 more...]]`` + `` [''''»''' [link asio.reference.ssl__context.context.overload2 more...]]`` -[section:overload1 ssl::context::context (1 of 3 overloads)] +[section:overload1 ssl::context::context (1 of 2 overloads)] Constructor. @@ -89384,23 +97242,7 @@ -[section:overload2 ssl::context::context (2 of 3 overloads)] - - -Deprecated constructor taking a reference to an [link asio.reference.io_service `io_service`] object. - - - context( - asio::io_service & , - method m); - - - -[endsect] - - - -[section:overload3 ssl::context::context (3 of 3 overloads)] +[section:overload2 ssl::context::context (2 of 2 overloads)] Move-construct a context from another. @@ -89486,43 +97328,6 @@ [endsect] - -[section:impl ssl::context::impl] - -[indexterm2 impl..ssl::context] -(Deprecated: Use `native_handle()`.) Get the underlying implementation in the native type. - - - impl_type impl(); - - -This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided. - - -[endsect] - - - -[section:impl_type ssl::context::impl_type] - -[indexterm2 impl_type..ssl::context] -(Deprecated: Use native\_handle\_type.) The native type of the SSL context. - - - typedef SSL_CTX * impl_type; - - - -[heading Requirements] - -['Header: ][^asio/ssl/context.hpp] - -['Convenience header: ][^asio/ssl.hpp] - - -[endsect] - - [section:load_verify_file ssl::context::load_verify_file] [indexterm2 load_verify_file..ssl::context] @@ -92184,13 +99989,6 @@ [ - [[link asio.reference.ssl__stream.impl_type [*impl_type]]] - [(Deprecated: Use native_handle_type.) The underlying implementation type. ] - - ] - - [ - [[link asio.reference.ssl__stream.lowest_layer_type [*lowest_layer_type]]] [The type of the lowest layer. ] @@ -92247,11 +100045,6 @@ ] [ - [[link asio.reference.ssl__stream.impl [*impl]]] - [(Deprecated: Use native_handle().) Get the underlying implementation in the native type. ] - ] - - [ [[link asio.reference.ssl__stream.lowest_layer [*lowest_layer]]] [Get a reference to the lowest layer. ] ] @@ -92817,43 +100610,6 @@ [endsect] - -[section:impl ssl::stream::impl] - -[indexterm2 impl..ssl::stream] -(Deprecated: Use `native_handle()`.) Get the underlying implementation in the native type. - - - impl_type impl(); - - -This function may be used to obtain the underlying implementation of the context. This is intended to allow access to stream functionality that is not otherwise provided. - - -[endsect] - - - -[section:impl_type ssl::stream::impl_type] - -[indexterm2 impl_type..ssl::stream] -(Deprecated: Use native\_handle\_type.) The underlying implementation type. - - - typedef impl_struct * impl_type; - - - -[heading Requirements] - -['Header: ][^asio/ssl/stream.hpp] - -['Convenience header: ][^asio/ssl.hpp] - - -[endsect] - - [section:lowest_layer ssl::stream::lowest_layer] [indexterm2 lowest_layer..ssl::stream] @@ -94126,6 +101882,13 @@ [ + [[link asio.reference.basic_waitable_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_waitable_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -94169,7 +101932,9 @@ Constructor to set a particular expiry time as an absolute time. - Constructor to set a particular expiry time relative to now. ] + Constructor to set a particular expiry time relative to now. + + Move-construct a basic_waitable_timer from another. ] ] [ @@ -94183,22 +101948,42 @@ ] [ + [[link asio.reference.basic_waitable_timer.expires_after [*expires_after]]] + [Set the timer's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_waitable_timer.expires_at [*expires_at]]] - [Get the timer's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the timer's expiry time as an absolute time. Set the timer's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_waitable_timer.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the timer's expiry time relative to now. - Set the timer's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the timer's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.expiry [*expiry]]] + [Get the timer's expiry time as an absolute time. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] ] [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.operator_eq_ [*operator=]]] + [Move-assign a basic_waitable_timer from another. ] ] [ @@ -94224,22 +102009,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_waitable_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_waitable_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_waitable_timer `basic_waitable_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A waitable timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -94267,7 +102036,7 @@ asio::steady_timer timer(io_service); // Set an expiry time relative to now. - timer.expires_from_now(std::chrono::seconds(5)); + timer.expires_after(std::chrono::seconds(5)); // Wait for the timer to expire. timer.wait(); @@ -94309,7 +102078,7 @@ void on_some_event() { - if (my_timer.expires_from_now(seconds(5)) > 0) + if (my_timer.expires_after(seconds(5)) > 0) { // We managed to cancel the timer. Start new asynchronous wait. my_timer.async_wait(on_timeout); @@ -94332,7 +102101,7 @@ -* The `asio::basic_waitable_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. +* The `asio::basic_waitable_timer::expires_after()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. * If a wait handler is cancelled, the [link asio.reference.error_code `error_code`] passed to it contains the value `asio::error::operation_aborted`. @@ -94357,116 +102126,243 @@ [endsect] - [section:strand strand] -[indexterm1 strand] -Typedef for backwards compatibility. + +Provides serialised function invocation for any executor type. - typedef asio::io_service::strand strand; + template< + typename ``[link asio.reference.Executor Executor]``> + class strand +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.strand.inner_executor_type [*inner_executor_type]]] + [The type of the underlying executor. ] + + ] + +] + [heading Member Functions] [table [[Name][Description]] [ - [[link asio.reference.io_service__strand.dispatch [*dispatch]]] - [Request the strand to invoke the given handler. ] + [[link asio.reference.strand.context [*context]]] + [Obtain the underlying execution context. ] ] [ - [[link asio.reference.io_service__strand.get_io_service [*get_io_service]]] - [Get the io_service associated with the strand. ] + [[link asio.reference.strand.defer [*defer]]] + [Request the strand to invoke the given function object. ] ] [ - [[link asio.reference.io_service__strand.post [*post]]] - [Request the strand to invoke the given handler and return immediately. ] + [[link asio.reference.strand.dispatch [*dispatch]]] + [Request the strand to invoke the given function object. ] ] [ - [[link asio.reference.io_service__strand.running_in_this_thread [*running_in_this_thread]]] + [[link asio.reference.strand.get_inner_executor [*get_inner_executor]]] + [Obtain the underlying executor. ] + ] + + [ + [[link asio.reference.strand.on_work_finished [*on_work_finished]]] + [Inform the strand that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.strand.on_work_started [*on_work_started]]] + [Inform the strand that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.strand.operator_eq_ [*operator=]]] + [Assignment operator. + + Converting assignment operator. + + Move assignment operator. + + Converting move assignment operator. ] + ] + + [ + [[link asio.reference.strand.post [*post]]] + [Request the strand to invoke the given function object. ] + ] + + [ + [[link asio.reference.strand.running_in_this_thread [*running_in_this_thread]]] [Determine whether the strand is running in the current thread. ] ] [ - [[link asio.reference.io_service__strand.strand [*strand]]] - [Constructor. ] + [[link asio.reference.strand.strand [*strand]]] + [Default constructor. + + Construct a strand for the specified executor. + + Copy constructor. + + Converting constructor. + + Move constructor. + + Converting move constructor. ] ] [ - [[link asio.reference.io_service__strand.wrap [*wrap]]] - [Create a new handler that automatically dispatches the wrapped handler on the strand. ] - ] - - [ - [[link asio.reference.io_service__strand._strand [*~strand]]] + [[link asio.reference.strand._strand [*~strand]]] [Destructor. ] ] ] -The [link asio.reference.io_service__strand `io_service::strand`] class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently. +[heading Friends] +[table + [[Name][Description]] - -[heading Order of handler invocation] + [ + [[link asio.reference.strand.operator_not__eq_ [*operator!=]]] + [Compare two strands for inequality. ] + ] -Given: - - -* a strand object `s` - - -* an object `a` meeting completion handler requirements - - -* an object `a1` which is an arbitrary copy of `a` made by the implementation - - -* an object `b` meeting completion handler requirements - - -* an object `b1` which is an arbitrary copy of `b` made by the implementation - -if any of the following conditions are true: - - -* `s.post(a)` happens-before `s.post(b)` - - -* `s.post(a)` happens-before `s.dispatch(b)`, where the latter is performed outside the strand - - -* `s.dispatch(a)` happens-before `s.post(b)`, where the former is performed outside the strand - - -* `s.dispatch(a)` happens-before `s.dispatch(b)`, where both are performed outside the strand - -then `asio_handler_invoke(a1, &a1)` happens-before `asio_handler_invoke(b1, &b1)`. - -Note that in the following case: - - async_op_1(..., s.wrap(a)); - async_op_2(..., s.wrap(b)); - - -the completion of the first async operation will perform `s.dispatch(a)`, and the second will perform `s.dispatch(b)`, but the order in which those are performed is unspecified. That is, you cannot state whether one happens-before the other. Therefore none of the above conditions are met and no ordering guarantee is made. - - -[heading Remarks] - -The implementation makes no guarantee that handlers posted or dispatched through different `strand` objects will be invoked concurrently. - - -[heading Thread Safety] + [ + [[link asio.reference.strand.operator_eq__eq_ [*operator==]]] + [Compare two strands for equality. ] + ] -['Distinct] ['objects:] Safe. +] -['Shared] ['objects:] Safe. +[heading Requirements] + +['Header: ][^asio/strand.hpp] + +['Convenience header: ][^asio.hpp] +[section:context strand::context] + +[indexterm2 context..strand] +Obtain the underlying execution context. + + + execution_context & context(); + + + +[endsect] + + + +[section:defer strand::defer] + +[indexterm2 defer..strand] +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's defer function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch strand::dispatch] + +[indexterm2 dispatch..strand] +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the strand to execute the given function object on its underlying executor. The function object will be executed inside this function if the strand is not otherwise busy and if the underlying executor's `dispatch()` function is also able to execute the function before returning. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:get_inner_executor strand::get_inner_executor] + +[indexterm2 get_inner_executor..strand] +Obtain the underlying executor. + + + inner_executor_type get_inner_executor() const; + + + +[endsect] + + + +[section:inner_executor_type strand::inner_executor_type] + +[indexterm2 inner_executor_type..strand] +The type of the underlying executor. + + + typedef Executor inner_executor_type; @@ -94480,6 +102376,425 @@ [endsect] + +[section:on_work_finished strand::on_work_finished] + +[indexterm2 on_work_finished..strand] +Inform the strand that some work is no longer outstanding. + + + void on_work_finished(); + + +The strand delegates this call to its underlying executor. + + +[endsect] + + + +[section:on_work_started strand::on_work_started] + +[indexterm2 on_work_started..strand] +Inform the strand that it has some outstanding work to do. + + + void on_work_started(); + + +The strand delegates this call to its underlying executor. + + +[endsect] + + + +[section:operator_not__eq_ strand::operator!=] + +[indexterm2 operator!=..strand] +Compare two strands for inequality. + + + friend bool operator!=( + const strand & a, + const strand & b); + + +Two strands are equal if they refer to the same ordered, non-concurrent state. + +[heading Requirements] + +['Header: ][^asio/strand.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:operator_eq_ strand::operator=] + +[indexterm2 operator=..strand] +Assignment operator. + + + strand & ``[link asio.reference.strand.operator_eq_.overload1 operator=]``( + const strand & other); + `` [''''»''' [link asio.reference.strand.operator_eq_.overload1 more...]]`` + + +Converting assignment operator. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand & ``[link asio.reference.strand.operator_eq_.overload2 operator=]``( + const strand< OtherExecutor > & other); + `` [''''»''' [link asio.reference.strand.operator_eq_.overload2 more...]]`` + + +Move assignment operator. + + + strand & ``[link asio.reference.strand.operator_eq_.overload3 operator=]``( + strand && other); + `` [''''»''' [link asio.reference.strand.operator_eq_.overload3 more...]]`` + + +Converting move assignment operator. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand & ``[link asio.reference.strand.operator_eq_.overload4 operator=]``( + const strand< OtherExecutor > && other); + `` [''''»''' [link asio.reference.strand.operator_eq_.overload4 more...]]`` + + +[section:overload1 strand::operator= (1 of 4 overloads)] + + +Assignment operator. + + + strand & operator=( + const strand & other); + + + +[endsect] + + + +[section:overload2 strand::operator= (2 of 4 overloads)] + + +Converting assignment operator. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand & operator=( + const strand< OtherExecutor > & other); + + +This assignment operator is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + + +[section:overload3 strand::operator= (3 of 4 overloads)] + + +Move assignment operator. + + + strand & operator=( + strand && other); + + + +[endsect] + + + +[section:overload4 strand::operator= (4 of 4 overloads)] + + +Converting move assignment operator. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand & operator=( + const strand< OtherExecutor > && other); + + +This assignment operator is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + +[endsect] + + +[section:operator_eq__eq_ strand::operator==] + +[indexterm2 operator==..strand] +Compare two strands for equality. + + + friend bool operator==( + const strand & a, + const strand & b); + + +Two strands are equal if they refer to the same ordered, non-concurrent state. + +[heading Requirements] + +['Header: ][^asio/strand.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:post strand::post] + +[indexterm2 post..strand] +Request the strand to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's defer function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:running_in_this_thread strand::running_in_this_thread] + +[indexterm2 running_in_this_thread..strand] +Determine whether the strand is running in the current thread. + + + bool running_in_this_thread() const; + + + +[heading Return Value] + +`true` if the current thread is executing a function that was submitted to the strand using `post()`, `dispatch()` or `defer()`. Otherwise returns `false`. + + + + +[endsect] + + +[section:strand strand::strand] + +[indexterm2 strand..strand] +Default constructor. + + + ``[link asio.reference.strand.strand.overload1 strand]``(); + `` [''''»''' [link asio.reference.strand.strand.overload1 more...]]`` + + +Construct a strand for the specified executor. + + + explicit ``[link asio.reference.strand.strand.overload2 strand]``( + const Executor & e); + `` [''''»''' [link asio.reference.strand.strand.overload2 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.strand.strand.overload3 strand]``( + const strand & other); + `` [''''»''' [link asio.reference.strand.strand.overload3 more...]]`` + + +Converting constructor. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.strand.strand.overload4 strand]``( + const strand< OtherExecutor > & other); + `` [''''»''' [link asio.reference.strand.strand.overload4 more...]]`` + + +Move constructor. + + + ``[link asio.reference.strand.strand.overload5 strand]``( + strand && other); + `` [''''»''' [link asio.reference.strand.strand.overload5 more...]]`` + + +Converting move constructor. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + ``[link asio.reference.strand.strand.overload6 strand]``( + strand< OtherExecutor > && other); + `` [''''»''' [link asio.reference.strand.strand.overload6 more...]]`` + + +[section:overload1 strand::strand (1 of 6 overloads)] + + +Default constructor. + + + strand(); + + +This constructor is only valid if the underlying executor type is default constructible. + + +[endsect] + + + +[section:overload2 strand::strand (2 of 6 overloads)] + + +Construct a strand for the specified executor. + + + strand( + const Executor & e); + + + +[endsect] + + + +[section:overload3 strand::strand (3 of 6 overloads)] + + +Copy constructor. + + + strand( + const strand & other); + + + +[endsect] + + + +[section:overload4 strand::strand (4 of 6 overloads)] + + +Converting constructor. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand( + const strand< OtherExecutor > & other); + + +This constructor is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + + +[section:overload5 strand::strand (5 of 6 overloads)] + + +Move constructor. + + + strand( + strand && other); + + + +[endsect] + + + +[section:overload6 strand::strand (6 of 6 overloads)] + + +Converting move constructor. + + + template< + class ``[link asio.reference.Executor OtherExecutor]``> + strand( + strand< OtherExecutor > && other); + + +This constructor is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + +[endsect] + + +[section:_strand strand::~strand] + +[indexterm2 ~strand..strand] +Destructor. + + + ~strand(); + + + +[endsect] + + + +[endsect] + [section:stream_socket_service stream_socket_service] @@ -94519,13 +102834,6 @@ [ - [[link asio.reference.stream_socket_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native socket type. ] - - ] - - [ - [[link asio.reference.stream_socket_service.protocol_type [*protocol_type]]] [The protocol type. ] @@ -94558,6 +102866,11 @@ ] [ + [[link asio.reference.stream_socket_service.async_wait [*async_wait]]] + [Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + + [ [[link asio.reference.stream_socket_service.at_mark [*at_mark]]] [Determine whether the socket is at the out-of-band data mark. ] ] @@ -94638,11 +102951,6 @@ ] [ - [[link asio.reference.stream_socket_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native socket implementation. ] - ] - - [ [[link asio.reference.stream_socket_service.native_handle [*native_handle]]] [Get the native socket implementation. ] ] @@ -94696,6 +103004,11 @@ [Construct a new stream socket service for the specified io_service. ] ] + [ + [[link asio.reference.stream_socket_service.wait [*wait]]] + [Wait for the socket to become ready to read, ready to write, or to have pending error conditions. ] + ] + ] [heading Data Members] @@ -94795,6 +103108,25 @@ +[section:async_wait stream_socket_service::async_wait] + +[indexterm2 async_wait..stream_socket_service] +Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + template< + typename ``[link asio.reference.WaitHandler WaitHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_wait( + implementation_type & impl, + socket_base::wait_type w, + WaitHandler handler); + + + +[endsect] + + + [section:at_mark stream_socket_service::at_mark] [indexterm2 at_mark..stream_socket_service] @@ -95117,21 +103449,6 @@ -[section:native stream_socket_service::native] - -[indexterm2 native..stream_socket_service] -(Deprecated: Use `native_handle()`.) Get the native socket implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle stream_socket_service::native_handle] [indexterm2 native_handle..stream_socket_service] @@ -95221,27 +103538,6 @@ [endsect] - -[section:native_type stream_socket_service::native_type] - -[indexterm2 native_type..stream_socket_service] -(Deprecated: Use native\_handle\_type.) The native socket type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/stream_socket_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - [section:non_blocking stream_socket_service::non_blocking] [indexterm2 non_blocking..stream_socket_service] @@ -95442,6 +103738,23 @@ +[section:wait stream_socket_service::wait] + +[indexterm2 wait..stream_socket_service] +Wait for the socket to become ready to read, ready to write, or to have pending error conditions. + + + asio::error_code wait( + implementation_type & impl, + socket_base::wait_type w, + asio::error_code & ec); + + + +[endsect] + + + [endsect] @@ -95811,6 +104124,893 @@ [endsect] +[section:system_executor system_executor] + + +An executor that uses arbitrary threads. + + + class system_executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.system_executor__thread_function [*thread_function]]] + [] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.system_executor.defer [*defer]]] + [Request the system executor to invoke the given function object. ] + ] + + [ + [[link asio.reference.system_executor.dispatch [*dispatch]]] + [Request the system executor to invoke the given function object. ] + ] + + [ + [[link asio.reference.system_executor.on_work_finished [*on_work_finished]]] + [Inform the executor that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.system_executor.on_work_started [*on_work_started]]] + [Inform the executor that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.system_executor.post [*post]]] + [Request the system executor to invoke the given function object. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.system_executor.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + +The system executor represents an execution context where functions are permitted to run on arbitrary threads. The `post()` and `defer()` functions schedule the function to run on an unspecified system thread pool, and `dispatch()` invokes the function immediately. + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:context system_executor::context] + +[indexterm2 context..system_executor] +Obtain the underlying execution context. + + + execution_context & context(); + + + +[endsect] + + + +[section:defer system_executor::defer] + +[indexterm2 defer..system_executor] +Request the system executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled to run on an unspecified system thread pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch system_executor::dispatch] + +[indexterm2 dispatch..system_executor] +Request the system executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will always be executed inside this function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:on_work_finished system_executor::on_work_finished] + +[indexterm2 on_work_finished..system_executor] +Inform the executor that some work is no longer outstanding. + + + void on_work_finished(); + + +For the system executor, this is a no-op. + + +[endsect] + + + +[section:on_work_started system_executor::on_work_started] + +[indexterm2 on_work_started..system_executor] +Inform the executor that it has some outstanding work to do. + + + void on_work_started(); + + +For the system executor, this is a no-op. + + +[endsect] + + + +[section:operator_not__eq_ system_executor::operator!=] + +[indexterm2 operator!=..system_executor] +Compare two executors for inequality. + + + friend bool operator!=( + const system_executor & , + const system_executor & ); + + +System executors always compare equal. + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ system_executor::operator==] + +[indexterm2 operator==..system_executor] +Compare two executors for equality. + + + friend bool operator==( + const system_executor & , + const system_executor & ); + + +System executors always compare equal. + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:post system_executor::post] + +[indexterm2 post..system_executor] +Request the system executor to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled to run on an unspecified system thread pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[endsect] + +[section:system_executor__context_impl system_executor::context_impl] + + + + struct context_impl : + public execution_context + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.system_executor__context_impl.fork_event [*fork_event]]] + [Fork-related event notifications. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__context_impl.context_impl [*context_impl]]] + [] + ] + + [ + [[link asio.reference.system_executor__context_impl.notify_fork [*notify_fork]]] + [Notify the execution_context of a fork-related event. ] + ] + + [ + [[link asio.reference.system_executor__context_impl._context_impl [*~context_impl]]] + [] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__context_impl.destroy_context [*destroy_context]]] + [Destroys all services in the context. ] + ] + + [ + [[link asio.reference.system_executor__context_impl.shutdown_context [*shutdown_context]]] + [Shuts down all services in the context. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__context_impl.scheduler_ [*scheduler_]]] + [] + ] + + [ + [[link asio.reference.system_executor__context_impl.threads_ [*threads_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__context_impl.add_service [*add_service]]] + [Add a service object to the execution_context. ] + ] + + [ + [[link asio.reference.system_executor__context_impl.has_service [*has_service]]] + [Determine if an execution_context contains a specified service type. ] + ] + + [ + [[link asio.reference.system_executor__context_impl.use_service [*use_service]]] + [Obtain the service object corresponding to the given type. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:add_service system_executor::context_impl::add_service] + + +['Inherited from execution_context.] + +[indexterm2 add_service..system_executor::context_impl] +Add a service object to the [link asio.reference.execution_context `execution_context`]. + + + template< + typename ``[link asio.reference.Service Service]``> + friend void add_service( + execution_context & e, + Service * svc); + + +This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: +`` + delete static_cast<execution_context::service*>(svc) +`` +]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] + +[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] + +] + + + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:context_impl system_executor::context_impl::context_impl] + +[indexterm2 context_impl..system_executor::context_impl] + + context_impl(); + + + +[endsect] + + + +[section:destroy_context system_executor::context_impl::destroy_context] + + +['Inherited from execution_context.] + +[indexterm2 destroy_context..system_executor::context_impl] +Destroys all services in the context. + + + void destroy_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order * of the beginning of service object lifetime, performs `delete static_cast<execution_context::service*>(svc)`. + + + + +[endsect] + + + +[section:fork_event system_executor::context_impl::fork_event] + + +['Inherited from execution_context.] + +[indexterm2 fork_event..system_executor::context_impl] +Fork-related event notifications. + + + enum fork_event + +[indexterm2 fork_prepare..system_executor::context_impl] +[indexterm2 fork_parent..system_executor::context_impl] +[indexterm2 fork_child..system_executor::context_impl] + +[heading Values] +[variablelist + + [ + [fork_prepare] + [Notify the context that the process is about to fork. ] + ] + + [ + [fork_parent] + [Notify the context that the process has forked and is the parent. ] + ] + + [ + [fork_child] + [Notify the context that the process has forked and is the child. ] + ] + +] + + + +[endsect] + + + +[section:has_service system_executor::context_impl::has_service] + + +['Inherited from execution_context.] + +[indexterm2 has_service..system_executor::context_impl] +Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend bool has_service( + execution_context & e); + + +This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. + + + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:notify_fork system_executor::context_impl::notify_fork] + + +['Inherited from execution_context.] + +[indexterm2 notify_fork..system_executor::context_impl] +Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. + + + void notify_fork( + fork_event event); + + +This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `execution_context`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. + +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the execution\_context's derived class, is being called in another thread. It is, however, safe to call this function from within a completion handler, provided no other thread is accessing the [link asio.reference.execution_context `execution_context`] or its derived class. + + +[heading Parameters] + + +[variablelist + +[[event][A fork-related event.]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] + +] + + +[heading Example] + +The following code illustrates how to incorporate the `notify_fork()` function: + + my_execution_context.notify_fork(execution_context::fork_prepare); + if (fork() == 0) + { + // This is the child process. + my_execution_context.notify_fork(execution_context::fork_child); + } + else + { + // This is the parent process. + my_execution_context.notify_fork(execution_context::fork_parent); + } + + + + + +[heading Remarks] + +For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, performs `svc->fork_service();`. When processing the fork\_prepare event, services are visited in reverse order of the beginning of service object lifetime. Otherwise, services are visited in order of the beginning of service object lifetime. + + + + +[endsect] + + + +[section:scheduler_ system_executor::context_impl::scheduler_] + +[indexterm2 scheduler_..system_executor::context_impl] + + detail::scheduler & scheduler_; + + + +[endsect] + + + +[section:shutdown_context system_executor::context_impl::shutdown_context] + + +['Inherited from execution_context.] + +[indexterm2 shutdown_context..system_executor::context_impl] +Shuts down all services in the context. + + + void shutdown_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. + + + + +[endsect] + + + +[section:threads_ system_executor::context_impl::threads_] + +[indexterm2 threads_..system_executor::context_impl] + + detail::thread_group threads_; + + + +[endsect] + + +[section:use_service system_executor::context_impl::use_service] + +[indexterm2 use_service..system_executor::context_impl] +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.system_executor__context_impl.use_service.overload1 use_service]``( + execution_context & e); + `` [''''»''' [link asio.reference.system_executor__context_impl.use_service.overload1 more...]]`` + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.system_executor__context_impl.use_service.overload2 use_service]``( + io_service & i); + `` [''''»''' [link asio.reference.system_executor__context_impl.use_service.overload2 more...]]`` + + +[section:overload1 system_executor::context_impl::use_service (1 of 2 overloads)] + + +['Inherited from execution_context.] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + execution_context & e); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.execution_context `execution_context`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 system_executor::context_impl::use_service (2 of 2 overloads)] + + +['Inherited from execution_context.] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + io_service & i); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.io_service `io_service`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[i][The [link asio.reference.io_service `io_service`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + +[heading Remarks] + +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. + + + +[heading Requirements] + +['Header: ][^asio/system_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[endsect] + + +[section:_context_impl system_executor::context_impl::~context_impl] + +[indexterm2 ~context_impl..system_executor::context_impl] + + ~context_impl(); + + + +[endsect] + + + +[endsect] + +[section:system_executor__thread_function system_executor::thread_function] + + + + struct thread_function + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__thread_function.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.system_executor__thread_function.scheduler_ [*scheduler_]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/impl/system_executor.ipp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ system_executor::thread_function::operator()] + +[indexterm2 operator()..system_executor::thread_function] + + void operator()(); + + + +[endsect] + + + +[section:scheduler_ system_executor::thread_function::scheduler_] + +[indexterm2 scheduler_..system_executor::thread_function] + + detail::scheduler * scheduler_; + + + +[endsect] + + + +[endsect] + [section:system_timer system_timer] @@ -95841,6 +105041,13 @@ [ + [[link asio.reference.basic_waitable_timer.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.basic_waitable_timer.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -95884,7 +105091,9 @@ Constructor to set a particular expiry time as an absolute time. - Constructor to set a particular expiry time relative to now. ] + Constructor to set a particular expiry time relative to now. + + Move-construct a basic_waitable_timer from another. ] ] [ @@ -95898,22 +105107,42 @@ ] [ + [[link asio.reference.basic_waitable_timer.expires_after [*expires_after]]] + [Set the timer's expiry time relative to now. ] + ] + + [ [[link asio.reference.basic_waitable_timer.expires_at [*expires_at]]] - [Get the timer's expiry time as an absolute time. + [(Deprecated: Use expiry().) Get the timer's expiry time as an absolute time. Set the timer's expiry time as an absolute time. ] ] [ [[link asio.reference.basic_waitable_timer.expires_from_now [*expires_from_now]]] - [Get the timer's expiry time relative to now. + [(Deprecated: Use expiry().) Get the timer's expiry time relative to now. - Set the timer's expiry time relative to now. ] + (Deprecated: Use expires_after().) Set the timer's expiry time relative to now. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.expiry [*expiry]]] + [Get the timer's expiry time as an absolute time. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.get_executor [*get_executor]]] + [Get the executor associated with the object. ] ] [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + ] + + [ + [[link asio.reference.basic_waitable_timer.operator_eq_ [*operator=]]] + [Move-assign a basic_waitable_timer from another. ] ] [ @@ -95939,22 +105168,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.basic_waitable_timer.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.basic_waitable_timer.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.basic_waitable_timer `basic_waitable_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire. A waitable timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately. @@ -95982,7 +105195,7 @@ asio::steady_timer timer(io_service); // Set an expiry time relative to now. - timer.expires_from_now(std::chrono::seconds(5)); + timer.expires_after(std::chrono::seconds(5)); // Wait for the timer to expire. timer.wait(); @@ -96024,7 +105237,7 @@ void on_some_event() { - if (my_timer.expires_from_now(seconds(5)) > 0) + if (my_timer.expires_after(seconds(5)) > 0) { // We managed to cancel the timer. Start new asynchronous wait. my_timer.async_wait(on_timeout); @@ -96047,7 +105260,7 @@ -* The `asio::basic_waitable_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. +* The `asio::basic_waitable_timer::expires_after()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled. * If a wait handler is cancelled, the [link asio.reference.error_code `error_code`] passed to it contains the value `asio::error::operation_aborted`. @@ -96207,6 +105420,987 @@ [endsect] +[section:thread_pool thread_pool] + + +A simple fixed-size thread pool. + + + class thread_pool : + public execution_context + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.thread_pool__executor_type [*executor_type]]] + [Executor used to submit functions to a thread pool. ] + + ] + + [ + + [[link asio.reference.thread_pool__thread_function [*thread_function]]] + [] + + ] + + [ + + [[link asio.reference.thread_pool.fork_event [*fork_event]]] + [Fork-related event notifications. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool.get_executor [*get_executor]]] + [Obtains the executor associated with the pool. ] + ] + + [ + [[link asio.reference.thread_pool.join [*join]]] + [Joins the threads. ] + ] + + [ + [[link asio.reference.thread_pool.notify_fork [*notify_fork]]] + [Notify the execution_context of a fork-related event. ] + ] + + [ + [[link asio.reference.thread_pool.stop [*stop]]] + [Stops the threads. ] + ] + + [ + [[link asio.reference.thread_pool.thread_pool [*thread_pool]]] + [Constructs a pool with an automatically determined number of threads. + + Constructs a pool with a specified number of threads. ] + ] + + [ + [[link asio.reference.thread_pool._thread_pool [*~thread_pool]]] + [Destructor. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool.destroy_context [*destroy_context]]] + [Destroys all services in the context. ] + ] + + [ + [[link asio.reference.thread_pool.shutdown_context [*shutdown_context]]] + [Shuts down all services in the context. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool.add_service [*add_service]]] + [Add a service object to the execution_context. ] + ] + + [ + [[link asio.reference.thread_pool.has_service [*has_service]]] + [Determine if an execution_context contains a specified service type. ] + ] + + [ + [[link asio.reference.thread_pool.use_service [*use_service]]] + [Obtain the service object corresponding to the given type. ] + ] + +] + +The thread pool class is an execution context where functions are permitted to run on one of a fixed number of threads. + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:add_service thread_pool::add_service] + + +['Inherited from execution_context.] + +[indexterm2 add_service..thread_pool] +Add a service object to the [link asio.reference.execution_context `execution_context`]. + + + template< + typename ``[link asio.reference.Service Service]``> + friend void add_service( + execution_context & e, + Service * svc); + + +This function is used to add a service to the [link asio.reference.execution_context `execution_context`]. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +[[svc][The service object. On success, ownership of the service object is transferred to the [link asio.reference.execution_context `execution_context`]. When the [link asio.reference.execution_context `execution_context`] object is destroyed, it will destroy the service object by performing: +`` + delete static_cast<execution_context::service*>(svc) +`` +]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::service_already_exists][Thrown if a service of the given type is already present in the [link asio.reference.execution_context `execution_context`].]] + +[[asio::invalid_service_owner][Thrown if the service's owning [link asio.reference.execution_context `execution_context`] is not the [link asio.reference.execution_context `execution_context`] object specified by the `e` parameter. ]] + +] + + + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:destroy_context thread_pool::destroy_context] + + +['Inherited from execution_context.] + +[indexterm2 destroy_context..thread_pool] +Destroys all services in the context. + + + void destroy_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order * of the beginning of service object lifetime, performs `delete static_cast<execution_context::service*>(svc)`. + + + + +[endsect] + + + +[section:fork_event thread_pool::fork_event] + + +['Inherited from execution_context.] + +[indexterm2 fork_event..thread_pool] +Fork-related event notifications. + + + enum fork_event + +[indexterm2 fork_prepare..thread_pool] +[indexterm2 fork_parent..thread_pool] +[indexterm2 fork_child..thread_pool] + +[heading Values] +[variablelist + + [ + [fork_prepare] + [Notify the context that the process is about to fork. ] + ] + + [ + [fork_parent] + [Notify the context that the process has forked and is the parent. ] + ] + + [ + [fork_child] + [Notify the context that the process has forked and is the child. ] + ] + +] + + + +[endsect] + + + +[section:get_executor thread_pool::get_executor] + +[indexterm2 get_executor..thread_pool] +Obtains the executor associated with the pool. + + + executor_type get_executor(); + + + +[endsect] + + + +[section:has_service thread_pool::has_service] + + +['Inherited from execution_context.] + +[indexterm2 has_service..thread_pool] +Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend bool has_service( + execution_context & e); + + +This function is used to determine whether the [link asio.reference.execution_context `execution_context`] contains a service object corresponding to the given service type. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +A boolean indicating whether the [link asio.reference.execution_context `execution_context`] contains the service. + + + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:join thread_pool::join] + +[indexterm2 join..thread_pool] +Joins the threads. + + + void join(); + + +This function blocks until the threads in the pool have completed. If `stop()` is not called prior to `join()`, the `join()` call will wait until the pool has no more outstanding work. + + +[endsect] + + + +[section:notify_fork thread_pool::notify_fork] + + +['Inherited from execution_context.] + +[indexterm2 notify_fork..thread_pool] +Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. + + + void notify_fork( + fork_event event); + + +This function is used to inform the [link asio.reference.execution_context `execution_context`] that the process is about to fork, or has just forked. This allows the [link asio.reference.execution_context `execution_context`], and the services it contains, to perform any necessary housekeeping to ensure correct operation following a fork. + +This function must not be called while any other [link asio.reference.execution_context `execution_context`] function, or any function associated with the execution\_context's derived class, is being called in another thread. It is, however, safe to call this function from within a completion handler, provided no other thread is accessing the [link asio.reference.execution_context `execution_context`] or its derived class. + + +[heading Parameters] + + +[variablelist + +[[event][A fork-related event.]] + +] + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure. If the notification fails the [link asio.reference.execution_context `execution_context`] object should no longer be used and should be destroyed.]] + +] + + +[heading Example] + +The following code illustrates how to incorporate the `notify_fork()` function: + + my_execution_context.notify_fork(execution_context::fork_prepare); + if (fork() == 0) + { + // This is the child process. + my_execution_context.notify_fork(execution_context::fork_child); + } + else + { + // This is the parent process. + my_execution_context.notify_fork(execution_context::fork_parent); + } + + + + + +[heading Remarks] + +For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, performs `svc->fork_service();`. When processing the fork\_prepare event, services are visited in reverse order of the beginning of service object lifetime. Otherwise, services are visited in order of the beginning of service object lifetime. + + + + +[endsect] + + + +[section:shutdown_context thread_pool::shutdown_context] + + +['Inherited from execution_context.] + +[indexterm2 shutdown_context..thread_pool] +Shuts down all services in the context. + + + void shutdown_context(); + + +This function is implemented as follows: + + +* For each service object `svc` in the [link asio.reference.execution_context `execution_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. + + + + +[endsect] + + + +[section:stop thread_pool::stop] + +[indexterm2 stop..thread_pool] +Stops the threads. + + + void stop(); + + +This function stops the threads as soon as possible. As a result of calling `stop()`, pending function objects may be never be invoked. + + +[endsect] + + +[section:thread_pool thread_pool::thread_pool] + +[indexterm2 thread_pool..thread_pool] +Constructs a pool with an automatically determined number of threads. + + + ``[link asio.reference.thread_pool.thread_pool.overload1 thread_pool]``(); + `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload1 more...]]`` + + +Constructs a pool with a specified number of threads. + + + ``[link asio.reference.thread_pool.thread_pool.overload2 thread_pool]``( + std::size_t num_threads); + `` [''''»''' [link asio.reference.thread_pool.thread_pool.overload2 more...]]`` + + +[section:overload1 thread_pool::thread_pool (1 of 2 overloads)] + + +Constructs a pool with an automatically determined number of threads. + + + thread_pool(); + + + +[endsect] + + + +[section:overload2 thread_pool::thread_pool (2 of 2 overloads)] + + +Constructs a pool with a specified number of threads. + + + thread_pool( + std::size_t num_threads); + + + +[endsect] + + +[endsect] + +[section:use_service thread_pool::use_service] + +[indexterm2 use_service..thread_pool] +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.thread_pool.use_service.overload1 use_service]``( + execution_context & e); + `` [''''»''' [link asio.reference.thread_pool.use_service.overload1 more...]]`` + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & ``[link asio.reference.thread_pool.use_service.overload2 use_service]``( + io_service & i); + `` [''''»''' [link asio.reference.thread_pool.use_service.overload2 more...]]`` + + +[section:overload1 thread_pool::use_service (1 of 2 overloads)] + + +['Inherited from execution_context.] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + execution_context & e); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.execution_context `execution_context`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 thread_pool::use_service (2 of 2 overloads)] + + +['Inherited from execution_context.] + + +Obtain the service object corresponding to the given type. + + + template< + typename ``[link asio.reference.Service Service]``> + friend Service & use_service( + io_service & i); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.io_service `io_service`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[i][The [link asio.reference.io_service `io_service`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + +[heading Remarks] + +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. + + + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[endsect] + + +[section:_thread_pool thread_pool::~thread_pool] + +[indexterm2 ~thread_pool..thread_pool] +Destructor. + + + ~thread_pool(); + + +Automatically stops and joins the pool, if not explicitly done beforehand. + + +[endsect] + + + +[endsect] + +[section:thread_pool__executor_type thread_pool::executor_type] + + +Executor used to submit functions to a thread pool. + + + class executor_type + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.defer [*defer]]] + [Request the thread pool to invoke the given function object. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.dispatch [*dispatch]]] + [Request the thread pool to invoke the given function object. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.on_work_finished [*on_work_finished]]] + [Inform the thread pool that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.on_work_started [*on_work_started]]] + [Inform the thread pool that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.post [*post]]] + [Request the thread pool to invoke the given function object. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the thread pool is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.thread_pool__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:context thread_pool::executor_type::context] + +[indexterm2 context..thread_pool::executor_type] +Obtain the underlying execution context. + + + thread_pool & context(); + + + +[endsect] + + + +[section:defer thread_pool::executor_type::defer] + +[indexterm2 defer..thread_pool::executor_type] +Request the thread pool to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function f, + const Allocator & a); + + +This function is used to ask the thread pool to execute the given function object. The function object will never be executed inside `defer()`. Instead, it will be scheduled to run on the thread pool. + +If the current thread belongs to the thread pool, `defer()` will delay scheduling the function object until the current thread returns control to the pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch thread_pool::executor_type::dispatch] + +[indexterm2 dispatch..thread_pool::executor_type] +Request the thread pool to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function f, + const Allocator & a); + + +This function is used to ask the thread pool to execute the given function object. If the current thread belongs to the pool, `dispatch()` executes the function before returning. Otherwise, the function will be scheduled to run on the thread pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:on_work_finished thread_pool::executor_type::on_work_finished] + +[indexterm2 on_work_finished..thread_pool::executor_type] +Inform the thread pool that some work is no longer outstanding. + + + void on_work_finished(); + + +This function is used to inform the thread pool that some work has finished. Once the count of unfinished work reaches zero, the thread pool's `join()` function is permitted to exit. + + +[endsect] + + + +[section:on_work_started thread_pool::executor_type::on_work_started] + +[indexterm2 on_work_started..thread_pool::executor_type] +Inform the thread pool that it has some outstanding work to do. + + + void on_work_started(); + + +This function is used to inform the thread pool that some work has begun. This ensures that the thread pool's `join()` function will not return while the work is underway. + + +[endsect] + + + +[section:operator_not__eq_ thread_pool::executor_type::operator!=] + +[indexterm2 operator!=..thread_pool::executor_type] +Compare two executors for inequality. + + + friend bool operator!=( + const executor_type & a, + const executor_type & b); + + +Two executors are equal if they refer to the same underlying thread pool. + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ thread_pool::executor_type::operator==] + +[indexterm2 operator==..thread_pool::executor_type] +Compare two executors for equality. + + + friend bool operator==( + const executor_type & a, + const executor_type & b); + + +Two executors are equal if they refer to the same underlying thread pool. + +[heading Requirements] + +['Header: ][^asio/thread_pool.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:post thread_pool::executor_type::post] + +[indexterm2 post..thread_pool::executor_type] +Request the thread pool to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function f, + const Allocator & a); + + +This function is used to ask the thread pool to execute the given function object. The function object will never be executed inside `post()`. Instead, it will be scheduled to run on the thread pool. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:running_in_this_thread thread_pool::executor_type::running_in_this_thread] + +[indexterm2 running_in_this_thread..thread_pool::executor_type] +Determine whether the thread pool is running in the current thread. + + + bool running_in_this_thread() const; + + + +[heading Return Value] + +`true` if the current thread belongs to the pool. Otherwise returns `false`. + + + + +[endsect] + + + +[endsect] + +[section:thread_pool__thread_function thread_pool::thread_function] + + + + struct thread_function + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool__thread_function.operator_lp__rp_ [*operator()]]] + [] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.thread_pool__thread_function.scheduler_ [*scheduler_]]] + [] + ] + +] + +[heading Requirements] + +['Header: ][^asio/impl/thread_pool.ipp] + +['Convenience header: ][^asio.hpp] + + +[section:operator_lp__rp_ thread_pool::thread_function::operator()] + +[indexterm2 operator()..thread_pool::thread_function] + + void operator()(); + + + +[endsect] + + + +[section:scheduler_ thread_pool::thread_function::scheduler_] + +[indexterm2 scheduler_..thread_pool::thread_function] + + detail::scheduler * scheduler_; + + + +[endsect] + + + +[endsect] + [section:time_traits_lt__ptime__gt_ time_traits< boost::posix_time::ptime >] @@ -96552,7 +106746,7 @@ ['Header: ][^asio/use_future.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [endsect] @@ -96621,7 +106815,7 @@ ['Header: ][^asio/use_future.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [section:allocator_type use_future_t::allocator_type] @@ -96638,7 +106832,7 @@ ['Header: ][^asio/use_future.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [endsect] @@ -96726,10 +106920,66 @@ [endsect] - [section:use_service use_service] [indexterm1 use_service] + + template< + typename ``[link asio.reference.Service Service]``> + Service & ``[link asio.reference.use_service.overload1 use_service]``( + execution_context & e); + `` [''''»''' [link asio.reference.use_service.overload1 more...]]`` + + template< + typename ``[link asio.reference.Service Service]``> + Service & ``[link asio.reference.use_service.overload2 use_service]``( + io_service & ios); + `` [''''»''' [link asio.reference.use_service.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^asio/impl/execution_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 use_service (1 of 2 overloads)] + + + + template< + typename ``[link asio.reference.Service Service]``> + Service & use_service( + execution_context & e); + + +This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link asio.reference.execution_context `execution_context`] will create a new instance of the service. + + +[heading Parameters] + + +[variablelist + +[[e][The [link asio.reference.execution_context `execution_context`] object that owns the service.]] + +] + + +[heading Return Value] + +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. + + + + +[endsect] + + + +[section:overload2 use_service (2 of 2 overloads)] + + template< typename ``[link asio.reference.Service Service]``> @@ -96745,27 +106995,51 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[i][The [link asio.reference.io_service `io_service`] object that owns the service.]] ] [heading Return Value] -The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. +The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller. +[heading Remarks] + +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. + + + + +[endsect] + + +[endsect] + +[section:uses_executor uses_executor] + + +The [link asio.reference.uses_executor `uses_executor`] trait detects whether a type T has an associated executor that is convertible from type Executor. + + + template< + typename T, + typename ``[link asio.reference.Executor Executor]``> + struct uses_executor + + +Meets the BinaryTypeTrait requirements. The Asio library provides a definition that is derived from false\_type. A program may specialize this template to derive from true\_type for a user-defined type T that can be constructed with an executor, where the first argument of a constructor has type [link asio.reference.executor_arg_t `executor_arg_t`] and the second argument is convertible from type Executor. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/uses_executor.hpp] ['Convenience header: ][^asio.hpp] [endsect] - [section:wait_traits wait_traits] @@ -96794,13 +107068,27 @@ ['Convenience header: ][^asio.hpp] - [section:to_wait_duration wait_traits::to_wait_duration] [indexterm2 to_wait_duration..wait_traits] Convert a clock duration into a duration used for waiting. + static Clock::duration ``[link asio.reference.wait_traits.to_wait_duration.overload1 to_wait_duration]``( + const typename Clock::duration & d); + `` [''''»''' [link asio.reference.wait_traits.to_wait_duration.overload1 more...]]`` + + static Clock::duration ``[link asio.reference.wait_traits.to_wait_duration.overload2 to_wait_duration]``( + const typename Clock::time_point & t); + `` [''''»''' [link asio.reference.wait_traits.to_wait_duration.overload2 more...]]`` + + +[section:overload1 wait_traits::to_wait_duration (1 of 2 overloads)] + + +Convert a clock duration into a duration used for waiting. + + static Clock::duration to_wait_duration( const typename Clock::duration & d); @@ -96817,6 +107105,30 @@ +[section:overload2 wait_traits::to_wait_duration (2 of 2 overloads)] + + +Convert a clock duration into a duration used for waiting. + + + static Clock::duration to_wait_duration( + const typename Clock::time_point & t); + + + +[heading Return Value] + +`d`. + + + + +[endsect] + + +[endsect] + + [endsect] [section:waitable_timer_service waitable_timer_service] @@ -96903,17 +107215,27 @@ ] [ + [[link asio.reference.waitable_timer_service.expires_after [*expires_after]]] + [Set the expiry time for the timer relative to now. ] + ] + + [ [[link asio.reference.waitable_timer_service.expires_at [*expires_at]]] - [Get the expiry time for the timer as an absolute time. + [(Deprecated: Use expiry().) Get the expiry time for the timer as an absolute time. Set the expiry time for the timer as an absolute time. ] ] [ [[link asio.reference.waitable_timer_service.expires_from_now [*expires_from_now]]] - [Get the expiry time for the timer relative to now. + [(Deprecated: Use expiry().) Get the expiry time for the timer relative to now. - Set the expiry time for the timer relative to now. ] + (Deprecated: Use expires_after().) Set the expiry time for the timer relative to now. ] + ] + + [ + [[link asio.reference.waitable_timer_service.expiry [*expiry]]] + [Get the expiry time for the timer as an absolute time. ] ] [ @@ -96922,6 +107244,16 @@ ] [ + [[link asio.reference.waitable_timer_service.move_assign [*move_assign]]] + [Move-assign from another timer implementation. ] + ] + + [ + [[link asio.reference.waitable_timer_service.move_construct [*move_construct]]] + [Move-construct a new timer implementation. ] + ] + + [ [[link asio.reference.waitable_timer_service.wait [*wait]]] [] ] @@ -97070,10 +107402,27 @@ [endsect] + +[section:expires_after waitable_timer_service::expires_after] + +[indexterm2 expires_after..waitable_timer_service] +Set the expiry time for the timer relative to now. + + + std::size_t expires_after( + implementation_type & impl, + const duration & expiry_time, + asio::error_code & ec); + + + +[endsect] + + [section:expires_at waitable_timer_service::expires_at] [indexterm2 expires_at..waitable_timer_service] -Get the expiry time for the timer as an absolute time. +(Deprecated: Use `expiry()`.) Get the expiry time for the timer as an absolute time. time_point ``[link asio.reference.waitable_timer_service.expires_at.overload1 expires_at]``( @@ -97094,7 +107443,7 @@ [section:overload1 waitable_timer_service::expires_at (1 of 2 overloads)] -Get the expiry time for the timer as an absolute time. +(Deprecated: Use `expiry()`.) Get the expiry time for the timer as an absolute time. time_point expires_at( @@ -97127,7 +107476,7 @@ [section:expires_from_now waitable_timer_service::expires_from_now] [indexterm2 expires_from_now..waitable_timer_service] -Get the expiry time for the timer relative to now. +(Deprecated: Use `expiry()`.) Get the expiry time for the timer relative to now. duration ``[link asio.reference.waitable_timer_service.expires_from_now.overload1 expires_from_now]``( @@ -97135,7 +107484,7 @@ `` [''''»''' [link asio.reference.waitable_timer_service.expires_from_now.overload1 more...]]`` -Set the expiry time for the timer relative to now. +(Deprecated: Use `expires_after()`.) Set the expiry time for the timer relative to now. std::size_t ``[link asio.reference.waitable_timer_service.expires_from_now.overload2 expires_from_now]``( @@ -97148,7 +107497,7 @@ [section:overload1 waitable_timer_service::expires_from_now (1 of 2 overloads)] -Get the expiry time for the timer relative to now. +(Deprecated: Use `expiry()`.) Get the expiry time for the timer relative to now. duration expires_from_now( @@ -97163,7 +107512,7 @@ [section:overload2 waitable_timer_service::expires_from_now (2 of 2 overloads)] -Set the expiry time for the timer relative to now. +(Deprecated: Use `expires_after()`.) Set the expiry time for the timer relative to now. std::size_t expires_from_now( @@ -97179,6 +107528,21 @@ [endsect] +[section:expiry waitable_timer_service::expiry] + +[indexterm2 expiry..waitable_timer_service] +Get the expiry time for the timer as an absolute time. + + + time_point expiry( + const implementation_type & impl) const; + + + +[endsect] + + + [section:get_io_service waitable_timer_service::get_io_service] @@ -97231,6 +107595,39 @@ +[section:move_assign waitable_timer_service::move_assign] + +[indexterm2 move_assign..waitable_timer_service] +Move-assign from another timer implementation. + + + void move_assign( + implementation_type & impl, + waitable_timer_service & other_service, + implementation_type & other_impl); + + + +[endsect] + + + +[section:move_construct waitable_timer_service::move_construct] + +[indexterm2 move_construct..waitable_timer_service] +Move-construct a new timer implementation. + + + void move_construct( + implementation_type & impl, + implementation_type & other_impl); + + + +[endsect] + + + [section:time_point waitable_timer_service::time_point] [indexterm2 time_point..waitable_timer_service] @@ -97322,6 +107719,13 @@ [ + [[link asio.reference.windows__basic_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -97343,13 +107747,6 @@ [ - [[link asio.reference.windows__basic_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -97386,8 +107783,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -97403,11 +107805,6 @@ ] [ - [[link asio.reference.windows__basic_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -97440,22 +107837,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_handle `windows::basic_handle`] class template provides the ability to wrap a Windows handle. @@ -97799,6 +108180,104 @@ [endsect] + +[section:executor_type windows::basic_handle::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..windows::basic_handle] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/windows/basic_handle.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor windows::basic_handle::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..windows::basic_handle] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation windows::basic_handle::get_implementation] [indexterm2 get_implementation..windows::basic_handle] @@ -97854,7 +108333,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_handle] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -97922,23 +108401,6 @@ [endsect] -[section:implementation windows::basic_handle::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..windows::basic_handle] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type windows::basic_handle::implementation_type] @@ -98056,6 +108518,13 @@ [ + [[link asio.reference.windows__basic_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -98077,13 +108546,6 @@ [ - [[link asio.reference.windows__basic_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -98120,8 +108582,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -98137,11 +108604,6 @@ ] [ - [[link asio.reference.windows__basic_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -98174,22 +108636,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_handle `windows::basic_handle`] class template provides the ability to wrap a Windows handle. @@ -98213,22 +108659,6 @@ -[section:native windows::basic_handle::native] - -[indexterm2 native..windows::basic_handle] -(Deprecated: Use `native_handle()`.) Get the native handle representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle windows::basic_handle::native_handle] [indexterm2 native_handle..windows::basic_handle] @@ -98266,27 +108696,6 @@ -[section:native_type windows::basic_handle::native_type] - -[indexterm2 native_type..windows::basic_handle] -(Deprecated: Use native\_handle\_type.) The native representation of a handle. - - - typedef HandleService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/basic_handle.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ windows::basic_handle::operator=] [indexterm2 operator=..windows::basic_handle] @@ -98321,30 +108730,6 @@ -[section:service windows::basic_handle::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..windows::basic_handle] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type windows::basic_handle::service_type] @@ -98403,6 +108788,13 @@ [ + [[link asio.reference.windows__basic_object_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_object_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -98424,13 +108816,6 @@ [ - [[link asio.reference.windows__basic_object_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_object_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -98472,8 +108857,13 @@ ] [ + [[link asio.reference.windows__basic_object_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_object_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -98489,11 +108879,6 @@ ] [ - [[link asio.reference.windows__basic_object_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_object_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -98526,22 +108911,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_object_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_object_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_object_handle `windows::basic_object_handle`] class template provides asynchronous and blocking object-oriented handle functionality. @@ -98940,6 +109309,104 @@ [endsect] + +[section:executor_type windows::basic_object_handle::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..windows::basic_object_handle] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/windows/basic_object_handle.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor windows::basic_object_handle::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..windows::basic_object_handle] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation windows::basic_object_handle::get_implementation] [indexterm2 get_implementation..windows::basic_object_handle] @@ -98995,7 +109462,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_object_handle] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -99063,23 +109530,6 @@ [endsect] -[section:implementation windows::basic_object_handle::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..windows::basic_object_handle] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type windows::basic_object_handle::implementation_type] @@ -99209,6 +109659,13 @@ [ + [[link asio.reference.windows__basic_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -99230,13 +109687,6 @@ [ - [[link asio.reference.windows__basic_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -99273,8 +109723,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -99290,11 +109745,6 @@ ] [ - [[link asio.reference.windows__basic_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -99327,22 +109777,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_handle `windows::basic_handle`] class template provides the ability to wrap a Windows handle. @@ -99366,25 +109800,6 @@ -[section:native windows::basic_object_handle::native] - - -['Inherited from windows::basic_handle.] - -[indexterm2 native..windows::basic_object_handle] -(Deprecated: Use `native_handle()`.) Get the native handle representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle windows::basic_object_handle::native_handle] @@ -99425,30 +109840,6 @@ -[section:native_type windows::basic_object_handle::native_type] - - -['Inherited from windows::basic_handle.] - -[indexterm2 native_type..windows::basic_object_handle] -(Deprecated: Use native\_handle\_type.) The native representation of a handle. - - - typedef ObjectHandleService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/basic_object_handle.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ windows::basic_object_handle::operator=] [indexterm2 operator=..windows::basic_object_handle] @@ -99483,30 +109874,6 @@ -[section:service windows::basic_object_handle::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..windows::basic_object_handle] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type windows::basic_object_handle::service_type] @@ -99623,6 +109990,13 @@ [ + [[link asio.reference.windows__basic_random_access_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_random_access_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -99644,13 +110018,6 @@ [ - [[link asio.reference.windows__basic_random_access_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_random_access_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -99697,8 +110064,13 @@ ] [ + [[link asio.reference.windows__basic_random_access_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -99714,11 +110086,6 @@ ] [ - [[link asio.reference.windows__basic_random_access_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_random_access_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -99756,22 +110123,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_random_access_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_random_access_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_random_access_handle `windows::basic_random_access_handle`] class template provides asynchronous and blocking random-access handle functionality. @@ -100253,6 +110604,104 @@ [endsect] + +[section:executor_type windows::basic_random_access_handle::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..windows::basic_random_access_handle] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/windows/basic_random_access_handle.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor windows::basic_random_access_handle::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..windows::basic_random_access_handle] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation windows::basic_random_access_handle::get_implementation] [indexterm2 get_implementation..windows::basic_random_access_handle] @@ -100308,7 +110757,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_random_access_handle] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -100376,23 +110825,6 @@ [endsect] -[section:implementation windows::basic_random_access_handle::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..windows::basic_random_access_handle] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type windows::basic_random_access_handle::implementation_type] @@ -100522,6 +110954,13 @@ [ + [[link asio.reference.windows__basic_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -100543,13 +110982,6 @@ [ - [[link asio.reference.windows__basic_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -100586,8 +111018,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -100603,11 +111040,6 @@ ] [ - [[link asio.reference.windows__basic_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -100640,22 +111072,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_handle `windows::basic_handle`] class template provides the ability to wrap a Windows handle. @@ -100679,25 +111095,6 @@ -[section:native windows::basic_random_access_handle::native] - - -['Inherited from windows::basic_handle.] - -[indexterm2 native..windows::basic_random_access_handle] -(Deprecated: Use `native_handle()`.) Get the native handle representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle windows::basic_random_access_handle::native_handle] @@ -100738,27 +111135,6 @@ -[section:native_type windows::basic_random_access_handle::native_type] - -[indexterm2 native_type..windows::basic_random_access_handle] -(Deprecated: Use native\_handle\_type.) The native representation of a handle. - - - typedef RandomAccessHandleService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/basic_random_access_handle.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ windows::basic_random_access_handle::operator=] [indexterm2 operator=..windows::basic_random_access_handle] @@ -100927,30 +111303,6 @@ [endsect] -[section:service windows::basic_random_access_handle::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..windows::basic_random_access_handle] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type windows::basic_random_access_handle::service_type] @@ -101129,6 +111481,13 @@ [ + [[link asio.reference.windows__basic_stream_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_stream_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -101150,13 +111509,6 @@ [ - [[link asio.reference.windows__basic_stream_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_stream_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -101203,8 +111555,13 @@ ] [ + [[link asio.reference.windows__basic_stream_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -101220,11 +111577,6 @@ ] [ - [[link asio.reference.windows__basic_stream_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_stream_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -101262,22 +111614,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_stream_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_stream_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_stream_handle `windows::basic_stream_handle`] class template provides asynchronous and blocking stream-oriented handle functionality. @@ -101754,6 +112090,104 @@ [endsect] + +[section:executor_type windows::basic_stream_handle::executor_type] + + +['Inherited from basic_io_object.] + +[indexterm2 executor_type..windows::basic_stream_handle] +The type of the executor associated with the object. + + + typedef asio::io_service::executor_type executor_type; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link asio.reference.io_service__executor_type.defer [*defer]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.dispatch [*dispatch]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_service that some work is no longer outstanding. ] + ] + + [ + [[link asio.reference.io_service__executor_type.on_work_started [*on_work_started]]] + [Inform the io_service that it has some outstanding work to do. ] + ] + + [ + [[link asio.reference.io_service__executor_type.post [*post]]] + [Request the io_service to invoke the given function object. ] + ] + + [ + [[link asio.reference.io_service__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_service is running in the current thread. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^asio/windows/basic_stream_handle.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:get_executor windows::basic_stream_handle::get_executor] + + +['Inherited from basic_io_object.] + +[indexterm2 get_executor..windows::basic_stream_handle] +Get the executor associated with the object. + + + executor_type get_executor(); + + + +[endsect] + + [section:get_implementation windows::basic_stream_handle::get_implementation] [indexterm2 get_implementation..windows::basic_stream_handle] @@ -101809,7 +112243,7 @@ ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_stream_handle] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. asio::io_service & get_io_service(); @@ -101877,23 +112311,6 @@ [endsect] -[section:implementation windows::basic_stream_handle::implementation] - - -['Inherited from basic_io_object.] - -[indexterm2 implementation..windows::basic_stream_handle] -(Deprecated: Use `get_implementation()`.) The underlying implementation of the I/O object. - - - implementation_type implementation; - - - -[endsect] - - - [section:implementation_type windows::basic_stream_handle::implementation_type] @@ -102023,6 +112440,13 @@ [ + [[link asio.reference.windows__basic_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -102044,13 +112468,6 @@ [ - [[link asio.reference.windows__basic_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -102087,8 +112504,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -102104,11 +112526,6 @@ ] [ - [[link asio.reference.windows__basic_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -102141,22 +112558,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_handle `windows::basic_handle`] class template provides the ability to wrap a Windows handle. @@ -102180,25 +112581,6 @@ -[section:native windows::basic_stream_handle::native] - - -['Inherited from windows::basic_handle.] - -[indexterm2 native..windows::basic_stream_handle] -(Deprecated: Use `native_handle()`.) Get the native handle representation. - - - native_type native(); - - -This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided. - - -[endsect] - - - [section:native_handle windows::basic_stream_handle::native_handle] @@ -102239,27 +112621,6 @@ -[section:native_type windows::basic_stream_handle::native_type] - -[indexterm2 native_type..windows::basic_stream_handle] -(Deprecated: Use native\_handle\_type.) The native representation of a handle. - - - typedef StreamHandleService::native_handle_type native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/basic_stream_handle.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:operator_eq_ windows::basic_stream_handle::operator=] [indexterm2 operator=..windows::basic_stream_handle] @@ -102420,30 +112781,6 @@ [endsect] -[section:service windows::basic_stream_handle::service] - - -['Inherited from basic_io_object.] - -[indexterm2 service..windows::basic_stream_handle] -(Deprecated: Use `get_service()`.) The service associated with the I/O object. - - - service_type & service; - - - -[heading Remarks] - -Available only for services that do not support movability. - - - - -[endsect] - - - [section:service_type windows::basic_stream_handle::service_type] @@ -102612,6 +112949,13 @@ [ + [[link asio.reference.windows__basic_object_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_object_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -102633,13 +112977,6 @@ [ - [[link asio.reference.windows__basic_object_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_object_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -102681,8 +113018,13 @@ ] [ + [[link asio.reference.windows__basic_object_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_object_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -102698,11 +113040,6 @@ ] [ - [[link asio.reference.windows__basic_object_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_object_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -102735,22 +113072,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_object_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_object_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_object_handle `windows::basic_object_handle`] class template provides asynchronous and blocking object-oriented handle functionality. @@ -103436,6 +113757,13 @@ [ + [[link asio.reference.windows__basic_random_access_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_random_access_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -103457,13 +113785,6 @@ [ - [[link asio.reference.windows__basic_random_access_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_random_access_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -103510,8 +113831,13 @@ ] [ + [[link asio.reference.windows__basic_random_access_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -103527,11 +113853,6 @@ ] [ - [[link asio.reference.windows__basic_random_access_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_random_access_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -103569,22 +113890,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_random_access_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_random_access_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_random_access_handle `windows::basic_random_access_handle`] class template provides asynchronous and blocking random-access handle functionality. @@ -103635,13 +113940,6 @@ ] - [ - - [[link asio.reference.windows__random_access_handle_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native handle type. ] - - ] - ] [heading Member Functions] @@ -103704,11 +114002,6 @@ ] [ - [[link asio.reference.windows__random_access_handle_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle implementation. ] - ] - - [ [[link asio.reference.windows__random_access_handle_service.native_handle [*native_handle]]] [Get the native handle implementation. ] ] @@ -103969,21 +114262,6 @@ -[section:native windows::random_access_handle_service::native] - -[indexterm2 native..windows::random_access_handle_service] -(Deprecated: Use `native_handle()`.) Get the native handle implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle windows::random_access_handle_service::native_handle] [indexterm2 native_handle..windows::random_access_handle_service] @@ -104020,27 +114298,6 @@ -[section:native_type windows::random_access_handle_service::native_type] - -[indexterm2 native_type..windows::random_access_handle_service] -(Deprecated: Use native\_handle\_type.) The native handle type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/random_access_handle_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:random_access_handle_service windows::random_access_handle_service::random_access_handle_service] [indexterm2 random_access_handle_service..windows::random_access_handle_service] @@ -104114,6 +114371,13 @@ [ + [[link asio.reference.windows__basic_stream_handle.executor_type [*executor_type]]] + [The type of the executor associated with the object. ] + + ] + + [ + [[link asio.reference.windows__basic_stream_handle.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -104135,13 +114399,6 @@ [ - [[link asio.reference.windows__basic_stream_handle.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native representation of a handle. ] - - ] - - [ - [[link asio.reference.windows__basic_stream_handle.service_type [*service_type]]] [The type of the service that will be used to provide I/O operations. ] @@ -104188,8 +114445,13 @@ ] [ + [[link asio.reference.windows__basic_stream_handle.get_executor [*get_executor]]] + [Get the executor associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] ] [ @@ -104205,11 +114467,6 @@ ] [ - [[link asio.reference.windows__basic_stream_handle.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle representation. ] - ] - - [ [[link asio.reference.windows__basic_stream_handle.native_handle [*native_handle]]] [Get the native handle representation. ] ] @@ -104247,22 +114504,6 @@ ] -[heading Protected Data Members] -[table - [[Name][Description]] - - [ - [[link asio.reference.windows__basic_stream_handle.implementation [*implementation]]] - [(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. ] - ] - - [ - [[link asio.reference.windows__basic_stream_handle.service [*service]]] - [(Deprecated: Use get_service().) The service associated with the I/O object. ] - ] - -] - The [link asio.reference.windows__basic_stream_handle `windows::basic_stream_handle`] class template provides asynchronous and blocking stream-oriented handle functionality. @@ -104314,13 +114555,6 @@ ] - [ - - [[link asio.reference.windows__stream_handle_service.native_type [*native_type]]] - [(Deprecated: Use native_handle_type.) The native handle type. ] - - ] - ] [heading Member Functions] @@ -104383,11 +114617,6 @@ ] [ - [[link asio.reference.windows__stream_handle_service.native [*native]]] - [(Deprecated: Use native_handle().) Get the native handle implementation. ] - ] - - [ [[link asio.reference.windows__stream_handle_service.native_handle [*native_handle]]] [Get the native handle implementation. ] ] @@ -104646,21 +114875,6 @@ -[section:native windows::stream_handle_service::native] - -[indexterm2 native..windows::stream_handle_service] -(Deprecated: Use `native_handle()`.) Get the native handle implementation. - - - native_type native( - implementation_type & impl); - - - -[endsect] - - - [section:native_handle windows::stream_handle_service::native_handle] [indexterm2 native_handle..windows::stream_handle_service] @@ -104697,27 +114911,6 @@ -[section:native_type windows::stream_handle_service::native_type] - -[indexterm2 native_type..windows::stream_handle_service] -(Deprecated: Use native\_handle\_type.) The native handle type. - - - typedef implementation_defined native_type; - - - -[heading Requirements] - -['Header: ][^asio/windows/stream_handle_service.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - [section:read_some windows::stream_handle_service::read_some] [indexterm2 read_some..windows::stream_handle_service] @@ -104773,6 +114966,78 @@ [endsect] +[section:wrap wrap] + +[indexterm1 wrap] +Associate an object of type `T` with an executor of type `Executor`. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename T> + executor_wrapper< typename decay< T >::type, Executor > ``[link asio.reference.wrap.overload1 wrap]``( + const Executor & ex, + T t, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.wrap.overload1 more...]]`` + + template< + typename ExecutionContext, + typename T> + executor_wrapper< typename decay< T >::type, typename ExecutionContext::executor_type > ``[link asio.reference.wrap.overload2 wrap]``( + ExecutionContext & ctx, + T t, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.wrap.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^asio/wrap.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 wrap (1 of 2 overloads)] + + +Associate an object of type `T` with an executor of type `Executor`. + + + template< + typename ``[link asio.reference.Executor Executor]``, + typename T> + executor_wrapper< typename decay< T >::type, Executor > wrap( + const Executor & ex, + T t, + typename enable_if< is_executor< Executor >::value >::type * = 0); + + + +[endsect] + + + +[section:overload2 wrap (2 of 2 overloads)] + + +Associate an object of type `T` with an execution context's executor. + + + template< + typename ExecutionContext, + typename T> + executor_wrapper< typename decay< T >::type, typename ExecutionContext::executor_type > wrap( + ExecutionContext & ctx, + T t, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[endsect] + + +[endsect] + [section:write write] [indexterm1 write] @@ -106164,7 +116429,9 @@ [ [[link asio.reference.basic_yield_context.basic_yield_context [*basic_yield_context]]] - [Construct a yield context to represent the specified coroutine. ] + [Construct a yield context to represent the specified coroutine. + + Construct a yield context from another yield context type. ] ] [ @@ -106196,7 +116463,7 @@ ['Header: ][^asio/spawn.hpp] -['Convenience header: ][^asio.hpp] +['Convenience header: ]None [endsect]
diff --git a/asio/src/doc/tutorial.qbk b/asio/src/doc/tutorial.qbk index fc1e58a..1201106 100644 --- a/asio/src/doc/tutorial.qbk +++ b/asio/src/doc/tutorial.qbk
@@ -611,7 +611,8 @@ [section:tuttimer5 Timer.5 - Synchronising handlers in multithreaded programs] -This tutorial demonstrates the use of the asio::strand class to synchronise callback handlers in a multithreaded program. +This tutorial demonstrates the use of the +[link asio.reference.io_service__strand io_service::strand] class to synchronise callback handlers in a multithreaded program. The previous four tutorials avoided the issue of handler synchronisation by calling the [link asio.reference.io_service.run io_service::run()] function from one thread only. As you already know, the asio library provides a guarantee that callback handlers will only be called from threads that are currently calling [link asio.reference.io_service.run io_service::run()]. Consequently, calling [link asio.reference.io_service.run io_service::run()] from only one thread ensures that callback handlers cannot run concurrently. @@ -649,9 +650,13 @@ -In addition to initialising a pair of asio::deadline\_timer members, the constructor initialises the `strand_` member, an object of type asio::strand. +In addition to initialising a pair of asio::deadline\_timer members, the constructor initialises the `strand_` member, an object of type +[link asio.reference.io_service__strand io_service::strand]. -An asio::strand guarantees that, for those handlers that are dispatched through it, an executing handler will be allowed to complete before the next one is started. This is guaranteed irrespective of the number of threads that are calling [link asio.reference.io_service.run io_service::run()]. Of course, the handlers may still execute concurrently with other handlers that were not dispatched through an asio::strand, or were dispatched through a different asio::strand object. +An +[link asio.reference.io_service__strand io_service::strand] guarantees that, for those handlers that are dispatched through it, an executing handler will be allowed to complete before the next one is started. This is guaranteed irrespective of the number of threads that are calling [link asio.reference.io_service.run io_service::run()]. Of course, the handlers may still execute concurrently with other handlers that were not dispatched through an +[link asio.reference.io_service__strand io_service::strand], or were dispatched through a different +[link asio.reference.io_service__strand io_service::strand] object. ``''''''`` printer(asio::io_service& io) @@ -663,11 +668,17 @@ -When initiating the asynchronous operations, each callback handler is "wrapped" using the asio::strand object. The [link asio.reference.io_service__strand.wrap strand::wrap()] function returns a new handler that automatically dispatches its contained handler through the asio::strand object. By wrapping the handlers using the same asio::strand, we are ensuring that they cannot execute concurrently. +When initiating the asynchronous operations, each callback handler is "wrapped" using the +[link asio.reference.io_service__strand io_service::strand] object. The [link asio.reference.io_service__strand.wrap io_service::strand::wrap()] function returns a new handler that automatically dispatches its contained handler through the +[link asio.reference.io_service__strand io_service::strand] object. By wrapping the handlers using the same +[link asio.reference.io_service__strand io_service::strand], we are ensuring that they cannot execute concurrently. - ``''''''`` timer1_.async_wait(strand_.wrap(boost::bind(&printer::print1, this))); - ``''''''`` timer2_.async_wait(strand_.wrap(boost::bind(&printer::print2, this))); + ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print1, this))); + + ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` ~printer() @@ -689,7 +700,9 @@ ``''''''`` ++count_; ``''''''`` timer1_.expires_at(timer1_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer1_.async_wait(strand_.wrap(boost::bind(&printer::print1, this))); + + ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print1, this))); ``''''''`` } ``''''''`` } @@ -701,12 +714,14 @@ ``''''''`` ++count_; ``''''''`` timer2_.expires_at(timer2_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer2_.async_wait(strand_.wrap(boost::bind(&printer::print2, this))); + + ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` } ``''''''``private: - ``''''''`` asio::strand strand_; + ``''''''`` asio::io_service::strand strand_; ``''''''`` asio::deadline_timer timer1_; ``''''''`` asio::deadline_timer timer2_; ``''''''`` int count_; @@ -771,8 +786,11 @@ ``''''''`` timer2_(io, boost::posix_time::seconds(1)), ``''''''`` count_(0) ``''''''`` { - ``''''''`` timer1_.async_wait(strand_.wrap(boost::bind(&printer::print1, this))); - ``''''''`` timer2_.async_wait(strand_.wrap(boost::bind(&printer::print2, this))); + ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print1, this))); + + ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` ~printer() @@ -788,7 +806,9 @@ ``''''''`` ++count_; ``''''''`` timer1_.expires_at(timer1_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer1_.async_wait(strand_.wrap(boost::bind(&printer::print1, this))); + + ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print1, this))); ``''''''`` } ``''''''`` } @@ -800,12 +820,14 @@ ``''''''`` ++count_; ``''''''`` timer2_.expires_at(timer2_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer2_.async_wait(strand_.wrap(boost::bind(&printer::print2, this))); + + ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` } ``''''''``private: - ``''''''`` asio::strand strand_; + ``''''''`` asio::io_service::strand strand_; ``''''''`` asio::deadline_timer timer1_; ``''''''`` asio::deadline_timer timer2_; ``''''''`` int count_; @@ -1235,7 +1257,7 @@ ``''''''`` void start_accept() ``''''''`` { ``''''''`` tcp_connection::pointer new_connection = - ``''''''`` tcp_connection::create(acceptor_.get_io_service()); + ``''''''`` tcp_connection::create(acceptor_.get_executor().context()); ``''''''`` acceptor_.async_accept(new_connection->socket(), ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection, @@ -1446,7 +1468,7 @@ ``''''''`` void start_accept() ``''''''`` { ``''''''`` tcp_connection::pointer new_connection = - ``''''''`` tcp_connection::create(acceptor_.get_io_service()); + ``''''''`` tcp_connection::create(acceptor_.get_executor().context()); ``''''''`` acceptor_.async_accept(new_connection->socket(), ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection, @@ -2145,7 +2167,7 @@ ``''''''`` void start_accept() ``''''''`` { ``''''''`` tcp_connection::pointer new_connection = - ``''''''`` tcp_connection::create(acceptor_.get_io_service()); + ``''''''`` tcp_connection::create(acceptor_.get_executor().context()); ``''''''`` acceptor_.async_accept(new_connection->socket(), ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection, @@ -2307,7 +2329,7 @@ ``''''''`` void start_accept() ``''''''`` { ``''''''`` tcp_connection::pointer new_connection = - ``''''''`` tcp_connection::create(acceptor_.get_io_service()); + ``''''''`` tcp_connection::create(acceptor_.get_executor().context()); ``''''''`` acceptor_.async_accept(new_connection->socket(), ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection,