Regenerate documentation.
diff --git a/asio/src/doc/reference.qbk b/asio/src/doc/reference.qbk index 52d3a46..0d80b34 100644 --- a/asio/src/doc/reference.qbk +++ b/asio/src/doc/reference.qbk
@@ -10,6 +10,7 @@ [xinclude quickref.xml] [include requirements/asynchronous_operations.qbk] +[include requirements/AcceptableProtocol.qbk] [include requirements/AcceptHandler.qbk] [include requirements/AsyncRandomAccessReadDevice.qbk] [include requirements/AsyncRandomAccessWriteDevice.qbk] @@ -17,7 +18,6 @@ [include requirements/AsyncWriteStream.qbk] [include requirements/BufferedHandshakeHandler.qbk] [include requirements/CompletionHandler.qbk] -[include requirements/ComposedConnectHandler.qbk] [include requirements/ConnectHandler.qbk] [include requirements/ConstBufferSequence.qbk] [include requirements/ConvertibleToConstBuffer.qbk] @@ -35,10 +35,12 @@ [include requirements/InternetProtocol.qbk] [include requirements/IoControlCommand.qbk] [include requirements/IoObjectService.qbk] +[include requirements/IteratorConnectHandler.qbk] [include requirements/MutableBufferSequence.qbk] [include requirements/ObjectHandleService.qbk] [include requirements/Protocol.qbk] [include requirements/RandomAccessHandleService.qbk] +[include requirements/RangeConnectHandler.qbk] [include requirements/RawSocketService.qbk] [include requirements/ReadHandler.qbk] [include requirements/ResolveHandler.qbk] @@ -228,7 +230,7 @@ ... ); `` [''''»''' [link asio.reference.asio_handler_invoke.overload2 more...]]`` -Completion handlers for asynchronous operations are invoked by the [link asio.reference.io_service `io_service`] associated with the corresponding object (e.g. a socket or deadline\_timer). Certain guarantees are made on when the handler may be invoked, in particular that a handler can only be invoked from a thread that is currently calling `run()` on the corresponding [link asio.reference.io_service `io_service`] object. Handlers may subsequently be invoked through other objects (such as [link asio.reference.io_service__strand `io_service::strand`] objects) that provide additional guarantees. +Completion handlers for asynchronous operations are invoked by the [link asio.reference.io_context `io_context`] associated with the corresponding object (e.g. a socket or deadline\_timer). Certain guarantees are made on when the handler may be invoked, in particular that a handler can only be invoked from a thread that is currently calling `run()` on the corresponding [link asio.reference.io_context `io_context`] object. Handlers may subsequently be invoked through other objects (such as [link asio.reference.io_context__strand `io_context::strand`] objects) that provide additional guarantees. When asynchronous operations are composed from other asynchronous operations, all intermediate handlers should be invoked using the same method as the final handler. This is required to ensure that user-defined objects are not accessed in a way that may violate the guarantees. This hooking function ensures that the invoked method used for the final handler is accessible at each intermediate step. @@ -607,7 +609,7 @@ async_completion( - typename remove_reference< Handler >::type & orig_handler); + Handler & orig_handler); The constructor creates the concrete handler and makes the link between the handler and the asynchronous result. @@ -694,52 +696,80 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, + typename ``[link asio.reference.RangeConnectHandler RangeConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload1 async_connect]``( basic_socket< Protocol, SocketService > & s, - Iterator begin, - ComposedConnectHandler && handler); + const EndpointSequence & endpoints, + RangeConnectHandler && handler, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.async_connect.overload1 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload2 async_connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - Iterator end, - ComposedConnectHandler && handler); + IteratorConnectHandler && handler, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); `` [''''»''' [link asio.reference.async_connect.overload2 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, - typename ConnectCondition, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload3 async_connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - ConnectCondition connect_condition, - ComposedConnectHandler && handler); + Iterator end, + IteratorConnectHandler && handler); `` [''''»''' [link asio.reference.async_connect.overload3 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, + typename ConnectCondition, + typename ``[link asio.reference.RangeConnectHandler RangeConnectHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload4 async_connect]``( + basic_socket< Protocol, SocketService > & s, + const EndpointSequence & endpoints, + ConnectCondition connect_condition, + RangeConnectHandler && handler, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); + `` [''''»''' [link asio.reference.async_connect.overload4 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, typename ConnectCondition, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> - ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload4 async_connect]``( + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload5 async_connect]``( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + IteratorConnectHandler && handler, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + `` [''''»''' [link asio.reference.async_connect.overload5 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition, + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.async_connect.overload6 async_connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, Iterator end, ConnectCondition connect_condition, - ComposedConnectHandler && handler); - `` [''''»''' [link asio.reference.async_connect.overload4 more...]]`` + IteratorConnectHandler && handler); + `` [''''»''' [link asio.reference.async_connect.overload6 more...]]`` [heading Requirements] @@ -748,7 +778,7 @@ ['Convenience header: ][^asio.hpp] -[section:overload1 async_connect (1 of 4 overloads)] +[section:overload1 async_connect (1 of 6 overloads)] Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -757,12 +787,104 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, + typename ``[link asio.reference.RangeConnectHandler RangeConnectHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( + basic_socket< Protocol, SocketService > & s, + const EndpointSequence & endpoints, + RangeConnectHandler && handler, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[endpoints][A sequence of endpoints.]] + +[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + // Result of operation. if the sequence is empty, set to + // asio::error::not_found. Otherwise, contains the + // error from the last connection attempt. + const asio::error_code& error, + + // On success, the successfully connected endpoint. + // Otherwise, a default-constructed endpoint. + const typename Protocol::endpoint& endpoint + ); +`` +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_context::post()`.]] + +] + + +[heading Example] + + + + tcp::resolver r(io_context); + tcp::resolver::query q("host", "service"); + tcp::socket s(io_context); + + // ... + + r.async_resolve(q, resolve_handler); + + // ... + + void resolve_handler( + const asio::error_code& ec, + tcp::resolver::results_type results) + { + if (!ec) + { + asio::async_connect(s, results, connect_handler); + } + } + + // ... + + void connect_handler( + const asio::error_code& ec, + const tcp::endpoint& endpoint) + { + // ... + } + + + + + + + +[endsect] + + + +[section:overload2 async_connect (2 of 6 overloads)] + + +(Deprecated.) Asynchronously establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( basic_socket< Protocol, SocketService > & s, Iterator begin, - ComposedConnectHandler && handler); + IteratorConnectHandler && handler, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -790,51 +912,14 @@ Iterator iterator ); `` -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()`.]] +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_context::post()`.]] ] [heading Remarks] -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. - - -[heading Example] - - - - tcp::resolver r(io_service); - tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); - - // ... - - r.async_resolve(q, resolve_handler); - - // ... - - void resolve_handler( - const asio::error_code& ec, - tcp::resolver::iterator i) - { - if (!ec) - { - asio::async_connect(s, i, connect_handler); - } - } - - // ... - - void connect_handler( - const asio::error_code& ec, - tcp::resolver::iterator i) - { - // ... - } - - - +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. @@ -843,7 +928,7 @@ -[section:overload2 async_connect (2 of 4 overloads)] +[section:overload3 async_connect (3 of 6 overloads)] Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -853,12 +938,12 @@ typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( basic_socket< Protocol, SocketService > & s, Iterator begin, Iterator end, - ComposedConnectHandler && handler); + IteratorConnectHandler && handler); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -888,7 +973,7 @@ Iterator iterator ); `` -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()`.]] +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_context::post()`.]] ] @@ -897,32 +982,17 @@ - tcp::resolver r(io_service); - tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); - - // ... - - r.async_resolve(q, resolve_handler); - - // ... - - void resolve_handler( - const asio::error_code& ec, - tcp::resolver::iterator i) - { - if (!ec) - { - tcp::resolver::iterator end; - asio::async_connect(s, i, end, connect_handler); - } - } + std::vector<tcp::endpoint> endpoints = ...; + tcp::socket s(io_context); + asio::async_connect(s, + endpoints.begin(), endpoints.end(), + connect_handler); // ... void connect_handler( const asio::error_code& ec, - tcp::resolver::iterator i) + std::vector<tcp::endpoint>::iterator i) { // ... } @@ -937,7 +1007,7 @@ -[section:overload3 async_connect (3 of 4 overloads)] +[section:overload4 async_connect (4 of 6 overloads)] Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -946,14 +1016,15 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ConnectCondition, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.RangeConnectHandler RangeConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( basic_socket< Protocol, SocketService > & s, - Iterator begin, + const EndpointSequence & endpoints, ConnectCondition connect_condition, - ComposedConnectHandler && handler); + RangeConnectHandler && handler, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -966,15 +1037,15 @@ [[s][The socket to be connected. If the socket is already open, it will be closed.]] -[[begin][An iterator pointing to the start of a sequence of endpoints.]] +[[endpoints][A sequence of endpoints.]] [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] [[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be: `` @@ -989,39 +1060,33 @@ Iterator iterator ); `` -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()`.]] +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_context::post()`.]] ] -[heading Remarks] - -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. - - [heading Example] The following connect condition function object can be used to output information about the individual connection attempts: struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); + tcp::socket s(io_context); // ... @@ -1031,11 +1096,11 @@ void resolve_handler( const asio::error_code& ec, - tcp::resolver::iterator i) + tcp::resolver::results_type results) { if (!ec) { - asio::async_connect(s, i, + asio::async_connect(s, results, my_connect_condition(), connect_handler); } @@ -1045,7 +1110,7 @@ void connect_handler( const asio::error_code& ec, - tcp::resolver::iterator i) + const tcp::endpoint& endpoint) { if (ec) { @@ -1053,7 +1118,7 @@ } else { - std::cout << "Connected to: " << i->endpoint() << std::endl; + std::cout << "Connected to: " << endpoint << std::endl; } } @@ -1067,7 +1132,76 @@ -[section:overload4 async_connect (4 of 4 overloads)] +[section:overload5 async_connect (5 of 6 overloads)] + + +(Deprecated.) Asynchronously establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition, + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + IteratorConnectHandler && handler, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[begin][An iterator pointing to the start of a sequence of endpoints.]] + +[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: +`` + bool connect_condition( + const asio::error_code& ec, + const typename Protocol::endpoint& next); +`` +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] + +[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be: +`` + void handler( + // Result of operation. if the sequence is empty, set to + // asio::error::not_found. Otherwise, contains the + // error from the last connection attempt. + const asio::error_code& error, + + // On success, an iterator denoting the successfully + // connected endpoint. Otherwise, the end iterator. + Iterator iterator + ); +`` +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_context::post()`.]] + +] + + +[heading Remarks] + +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. + + + + +[endsect] + + + +[section:overload6 async_connect (6 of 6 overloads)] Asynchronously establishes a socket connection by trying each endpoint in a sequence. @@ -1078,13 +1212,13 @@ typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, typename ConnectCondition, - typename ``[link asio.reference.ComposedConnectHandler ComposedConnectHandler]``> + typename ``[link asio.reference.IteratorConnectHandler IteratorConnectHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_connect( basic_socket< Protocol, SocketService > & s, Iterator begin, Iterator end, ConnectCondition connect_condition, - ComposedConnectHandler && handler); + IteratorConnectHandler && handler); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -1103,11 +1237,11 @@ [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] [[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be: `` @@ -1122,7 +1256,7 @@ Iterator iterator ); `` -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()`.]] +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_context::post()`.]] ] @@ -1133,23 +1267,22 @@ struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); + tcp::socket s(io_context); // ... @@ -1329,7 +1462,7 @@ // prior to the error. ); `` -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()`.]] +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_context::post()`.]] ] @@ -1424,7 +1557,7 @@ // prior to the error. ); `` -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()`.]] +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_context::post()`.]] ] @@ -1497,7 +1630,7 @@ // prior to the error. ); `` -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()`.]] +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_context::post()`.]] ] @@ -1584,7 +1717,7 @@ // prior to the error. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -1643,7 +1776,7 @@ // prior to the error. ); `` -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()`.]] +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_context::post()`.]] ] @@ -1729,7 +1862,7 @@ // prior to the error. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -1853,7 +1986,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -1950,7 +2083,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2022,7 +2155,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2108,7 +2241,7 @@ std::size_t bytes_transferred ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -2276,7 +2409,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2380,7 +2513,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2485,7 +2618,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2600,7 +2733,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2728,7 +2861,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2833,7 +2966,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -2939,7 +3072,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -3054,7 +3187,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -3366,7 +3499,7 @@ // of the buffer sizes. ); `` -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()`.]] +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_context::post()`.]] ] @@ -3449,7 +3582,7 @@ // of the buffer sizes. ); `` -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()`.]] +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_context::post()`.]] ] @@ -3521,7 +3654,7 @@ // of the buffer sizes. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -3594,7 +3727,7 @@ // of the buffer sizes. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -3652,7 +3785,7 @@ // of the buffer sizes. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -3724,7 +3857,7 @@ // of the buffer sizes. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -3847,7 +3980,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -3932,7 +4065,7 @@ std::size_t bytes_transferred ); `` -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()`.]] +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_context::post()`.]] ] @@ -4006,7 +4139,7 @@ std::size_t bytes_transferred ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -4081,7 +4214,7 @@ std::size_t bytes_transferred ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -4419,8 +4552,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -4680,7 +4818,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -4699,7 +4837,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -4768,7 +4906,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -4828,7 +4966,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -4905,7 +5043,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -4964,7 +5102,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -5031,7 +5169,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -5091,7 +5229,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -5168,7 +5306,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -5229,7 +5367,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -5274,7 +5412,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -5293,7 +5431,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -5489,7 +5627,7 @@ explicit ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload1 basic_datagram_socket]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload1 more...]]`` @@ -5497,7 +5635,7 @@ ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload2 basic_datagram_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload2 more...]]`` @@ -5506,7 +5644,7 @@ ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload3 basic_datagram_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload3 more...]]`` @@ -5515,7 +5653,7 @@ ``[link asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 basic_datagram_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); `` [''''»''' [link asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 more...]]`` @@ -5548,7 +5686,7 @@ basic_datagram_socket( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a datagram socket without opening it. The `open()` function must be called before data can be sent or received on the socket. @@ -5559,7 +5697,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] ] @@ -5577,7 +5715,7 @@ basic_datagram_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -5589,7 +5727,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -5619,7 +5757,7 @@ basic_datagram_socket( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); @@ -5631,7 +5769,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[endpoint][An endpoint on the local machine to which the datagram socket will be bound.]] @@ -5661,7 +5799,7 @@ basic_datagram_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); @@ -5674,7 +5812,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the datagram socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -5724,7 +5862,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_context&) constructor`. @@ -5762,7 +5900,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_context&) constructor`. @@ -5828,7 +5966,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -5876,7 +6014,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -5918,7 +6056,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -5929,7 +6067,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -5972,7 +6110,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -6190,7 +6328,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -6273,7 +6411,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.connect(endpoint); @@ -6323,7 +6461,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -6365,7 +6503,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -6376,7 +6514,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -6419,7 +6557,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -6430,7 +6568,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -6473,7 +6611,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -6484,7 +6622,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -6537,7 +6675,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -6545,38 +6683,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -6586,12 +6724,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -6674,24 +6812,50 @@ [endsect] +[section:get_io_context basic_datagram_socket::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_datagram_socket] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_datagram_socket::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_datagram_socket] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -6758,7 +6922,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -6810,7 +6974,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -6963,7 +7127,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -7015,7 +7179,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -7075,7 +7239,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -7086,7 +7250,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -7129,7 +7293,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -7140,7 +7304,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -7211,7 +7375,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -7260,7 +7424,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -7593,8 +7757,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -8443,7 +8612,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -8489,7 +8658,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -8555,7 +8724,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_context&) constructor`. @@ -8592,7 +8761,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_datagram_socket(io_context&) constructor`. @@ -8835,7 +9004,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -8846,7 +9015,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -9079,7 +9248,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -9090,7 +9259,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -9160,7 +9329,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -9209,7 +9378,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -9250,7 +9419,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -9261,7 +9430,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -9495,7 +9664,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -9506,7 +9675,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -9549,7 +9718,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -9560,7 +9729,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -9855,7 +10024,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -9906,7 +10075,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -9983,7 +10152,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -10030,7 +10199,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -10137,7 +10306,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -10184,7 +10353,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -10356,8 +10525,13 @@ ] [ + [[link asio.reference.basic_deadline_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -10402,7 +10576,7 @@ Performing a blocking wait: // Construct a timer without setting an expiry time. - asio::deadline_timer timer(io_service); + asio::deadline_timer timer(io_context); // Set an expiry time relative to now. timer.expires_from_now(boost::posix_time::seconds(5)); @@ -10427,7 +10601,7 @@ ... // Construct a timer with an absolute expiry time. - asio::deadline_timer timer(io_service, + asio::deadline_timer timer(io_context, boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); // Start an asynchronous wait. @@ -10518,7 +10692,7 @@ 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()`. ]] +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_context::post()`. ]] ] @@ -10535,7 +10709,7 @@ explicit ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload1 basic_deadline_timer]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload1 more...]]`` @@ -10543,7 +10717,7 @@ ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload2 basic_deadline_timer]``( - asio::io_service & io_service, + asio::io_context & io_context, const time_type & expiry_time); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload2 more...]]`` @@ -10552,7 +10726,7 @@ ``[link asio.reference.basic_deadline_timer.basic_deadline_timer.overload3 basic_deadline_timer]``( - asio::io_service & io_service, + asio::io_context & io_context, const duration_type & expiry_time); `` [''''»''' [link asio.reference.basic_deadline_timer.basic_deadline_timer.overload3 more...]]`` @@ -10564,7 +10738,7 @@ basic_deadline_timer( - asio::io_service & io_service); + asio::io_context & io_context); 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. @@ -10575,7 +10749,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. ]] ] @@ -10593,7 +10767,7 @@ basic_deadline_timer( - asio::io_service & io_service, + asio::io_context & io_context, const time_type & expiry_time); @@ -10605,7 +10779,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] [[expiry_time][The expiry time to be used for the timer, expressed as an absolute time. ]] @@ -10625,7 +10799,7 @@ basic_deadline_timer( - asio::io_service & io_service, + asio::io_context & io_context, const duration_type & expiry_time); @@ -10637,7 +10811,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] [[expiry_time][The expiry time to be used for the timer, relative to now. ]] @@ -10898,7 +11072,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -10906,38 +11080,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -10947,12 +11121,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -11321,24 +11495,50 @@ [endsect] +[section:get_io_context basic_deadline_timer::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_deadline_timer] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_deadline_timer::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_deadline_timer] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -11607,8 +11807,13 @@ ] [ + [[link asio.reference.basic_io_object.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_io_object.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] ] @@ -11666,7 +11871,7 @@ explicit ``[link asio.reference.basic_io_object.basic_io_object.overload1 basic_io_object]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_io_object.basic_io_object.overload1 more...]]`` @@ -11685,7 +11890,7 @@ basic_io_object( - asio::io_service & io_service); + asio::io_context & io_context); Performs: @@ -11738,7 +11943,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -11746,38 +11951,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -11787,12 +11992,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -11866,21 +12071,44 @@ [endsect] -[section:get_io_service basic_io_object::get_io_service] +[section:get_io_context basic_io_object::get_io_context] -[indexterm2 get_io_service..basic_io_object] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +[indexterm2 get_io_context..basic_io_object] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_context(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + +[section:get_io_service basic_io_object::get_io_service] + +[indexterm2 get_io_service..basic_io_object] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_service(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -12289,8 +12517,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -12550,7 +12783,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -12569,7 +12802,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -12638,7 +12871,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -12698,7 +12931,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -12775,7 +13008,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -12834,7 +13067,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -12901,7 +13134,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -12961,7 +13194,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -13038,7 +13271,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -13099,7 +13332,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -13144,7 +13377,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -13163,7 +13396,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -13359,7 +13592,7 @@ explicit ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload1 basic_raw_socket]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload1 more...]]`` @@ -13367,7 +13600,7 @@ ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload2 basic_raw_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload2 more...]]`` @@ -13376,7 +13609,7 @@ ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload3 basic_raw_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload3 more...]]`` @@ -13385,7 +13618,7 @@ ``[link asio.reference.basic_raw_socket.basic_raw_socket.overload4 basic_raw_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); `` [''''»''' [link asio.reference.basic_raw_socket.basic_raw_socket.overload4 more...]]`` @@ -13418,7 +13651,7 @@ basic_raw_socket( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a raw socket without opening it. The `open()` function must be called before data can be sent or received on the socket. @@ -13429,7 +13662,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] ] @@ -13447,7 +13680,7 @@ basic_raw_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -13459,7 +13692,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -13489,7 +13722,7 @@ basic_raw_socket( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); @@ -13501,7 +13734,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[endpoint][An endpoint on the local machine to which the raw socket will be bound.]] @@ -13531,7 +13764,7 @@ basic_raw_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); @@ -13544,7 +13777,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -13594,7 +13827,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_context&) constructor`. @@ -13632,7 +13865,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_context&) constructor`. @@ -13698,7 +13931,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -13746,7 +13979,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -13788,7 +14021,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -13799,7 +14032,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -13842,7 +14075,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -14060,7 +14293,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -14143,7 +14376,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.connect(endpoint); @@ -14193,7 +14426,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -14235,7 +14468,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -14246,7 +14479,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -14289,7 +14522,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -14300,7 +14533,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -14343,7 +14576,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -14354,7 +14587,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -14407,7 +14640,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -14415,38 +14648,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -14456,12 +14689,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -14544,24 +14777,50 @@ [endsect] +[section:get_io_context basic_raw_socket::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_raw_socket] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_raw_socket::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_raw_socket] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -14628,7 +14887,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -14680,7 +14939,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -14833,7 +15092,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -14885,7 +15144,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -14945,7 +15204,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -14956,7 +15215,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -14999,7 +15258,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -15010,7 +15269,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -15081,7 +15340,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -15130,7 +15389,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -15463,8 +15722,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -16313,7 +16577,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -16359,7 +16623,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -16425,7 +16689,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_context&) constructor`. @@ -16462,7 +16726,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_raw_socket(io_context&) constructor`. @@ -16705,7 +16969,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -16716,7 +16980,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -16949,7 +17213,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -16960,7 +17224,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -17030,7 +17294,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -17079,7 +17343,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -17120,7 +17384,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -17131,7 +17395,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -17365,7 +17629,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -17376,7 +17640,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -17419,7 +17683,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -17430,7 +17694,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -17725,7 +17989,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -17776,7 +18040,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -17853,7 +18117,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -17900,7 +18164,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -18007,7 +18271,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -18054,7 +18318,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -18369,8 +18633,13 @@ ] [ + [[link asio.reference.basic_seq_packet_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_seq_packet_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -18622,7 +18891,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -18641,7 +18910,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -18715,7 +18984,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -18773,7 +19042,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -18832,7 +19101,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -18885,7 +19154,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -18904,7 +19173,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -19100,7 +19369,7 @@ explicit ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload1 basic_seq_packet_socket]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload1 more...]]`` @@ -19108,7 +19377,7 @@ ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 basic_seq_packet_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 more...]]`` @@ -19117,7 +19386,7 @@ ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload3 basic_seq_packet_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload3 more...]]`` @@ -19126,7 +19395,7 @@ ``[link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 basic_seq_packet_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); `` [''''»''' [link asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 more...]]`` @@ -19159,7 +19428,7 @@ basic_seq_packet_socket( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a sequenced packet socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it. @@ -19170,7 +19439,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] ] @@ -19188,7 +19457,7 @@ basic_seq_packet_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -19200,7 +19469,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -19230,7 +19499,7 @@ basic_seq_packet_socket( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); @@ -19242,7 +19511,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[endpoint][An endpoint on the local machine to which the sequenced packet socket will be bound.]] @@ -19272,7 +19541,7 @@ basic_seq_packet_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); @@ -19285,7 +19554,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -19335,7 +19604,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_context&) constructor`. @@ -19373,7 +19642,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_context&) constructor`. @@ -19439,7 +19708,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -19487,7 +19756,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -19529,7 +19798,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -19540,7 +19809,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -19583,7 +19852,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -19801,7 +20070,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -19884,7 +20153,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.connect(endpoint); @@ -19934,7 +20203,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -19976,7 +20245,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -19987,7 +20256,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -20030,7 +20299,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -20041,7 +20310,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -20084,7 +20353,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -20095,7 +20364,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -20148,7 +20417,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -20156,38 +20425,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -20197,12 +20466,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -20285,24 +20554,50 @@ [endsect] +[section:get_io_context basic_seq_packet_socket::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_seq_packet_socket] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_seq_packet_socket::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_seq_packet_socket] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -20369,7 +20664,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -20421,7 +20716,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -20574,7 +20869,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -20626,7 +20921,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -20686,7 +20981,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -20697,7 +20992,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -20740,7 +21035,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -20751,7 +21046,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -20822,7 +21117,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -20871,7 +21166,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -21204,8 +21499,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -22054,7 +22354,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -22100,7 +22400,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -22166,7 +22466,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_context&) constructor`. @@ -22203,7 +22503,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_seq_packet_socket(io_context&) constructor`. @@ -22467,7 +22767,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -22478,7 +22778,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -22521,7 +22821,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -22532,7 +22832,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -22602,7 +22902,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -22651,7 +22951,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -22692,7 +22992,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -22703,7 +23003,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -22875,7 +23175,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -22886,7 +23186,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -22929,7 +23229,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -22940,7 +23240,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -23045,7 +23345,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -23096,7 +23396,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -23173,7 +23473,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -23220,7 +23520,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -23327,7 +23627,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -23374,7 +23674,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -23536,8 +23836,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -23707,7 +24012,7 @@ std::size_t bytes_transferred // Number of bytes read. ); `` -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()`.]] +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_context::post()`.]] ] @@ -23764,7 +24069,7 @@ std::size_t bytes_transferred // Number of bytes written. ); `` -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()`.]] +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_context::post()`.]] ] @@ -23796,7 +24101,7 @@ explicit ``[link asio.reference.basic_serial_port.basic_serial_port.overload1 basic_serial_port]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload1 more...]]`` @@ -23804,12 +24109,12 @@ explicit ``[link asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``( - asio::io_service & io_service, + asio::io_context & io_context, const char * device); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload2 more...]]`` explicit ``[link asio.reference.basic_serial_port.basic_serial_port.overload3 basic_serial_port]``( - asio::io_service & io_service, + asio::io_context & io_context, const std::string & device); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload3 more...]]`` @@ -23818,7 +24123,7 @@ ``[link asio.reference.basic_serial_port.basic_serial_port.overload4 basic_serial_port]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_serial_port); `` [''''»''' [link asio.reference.basic_serial_port.basic_serial_port.overload4 more...]]`` @@ -23838,7 +24143,7 @@ basic_serial_port( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a serial port without opening it. @@ -23849,7 +24154,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]] ] @@ -23867,7 +24172,7 @@ basic_serial_port( - asio::io_service & io_service, + asio::io_context & io_context, const char * device); @@ -23879,7 +24184,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] [[device][The platform-specific device name for this serial port. ]] @@ -23899,7 +24204,7 @@ basic_serial_port( - asio::io_service & io_service, + asio::io_context & io_context, const std::string & device); @@ -23911,7 +24216,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] [[device][The platform-specific device name for this serial port. ]] @@ -23931,7 +24236,7 @@ basic_serial_port( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_serial_port); @@ -23943,7 +24248,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]] [[native_serial_port][A native serial port.]] @@ -23991,7 +24296,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_serial_port(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_serial_port(io_context&) constructor`. @@ -24155,7 +24460,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -24163,38 +24468,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -24204,12 +24509,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -24292,24 +24597,50 @@ [endsect] +[section:get_io_context basic_serial_port::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_serial_port] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_serial_port::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_serial_port] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -24402,7 +24733,7 @@ [[option][The option value to be obtained from the serial port.]] -[[ec][Set to indicate what error occured, if any.]] +[[ec][Set to indicate what error occurred, if any.]] ] @@ -24662,8 +24993,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -24909,7 +25245,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_serial_port(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_serial_port(io_context&) constructor`. @@ -25446,8 +25782,13 @@ ] [ + [[link asio.reference.basic_signal_set.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_signal_set.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -25502,7 +25843,7 @@ ... // Construct a signal set registered for process termination. - asio::signal_set signals(io_service, SIGINT, SIGTERM); + asio::signal_set signals(io_context, SIGINT, SIGTERM); // Start an asynchronous wait for one of the signals to occur. signals.async_wait(handler); @@ -25665,7 +26006,7 @@ int signal_number // Indicates which signal occurred. ); `` -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()`. ]] +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_context::post()`. ]] ] @@ -25682,7 +26023,7 @@ explicit ``[link asio.reference.basic_signal_set.basic_signal_set.overload1 basic_signal_set]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload1 more...]]`` @@ -25690,7 +26031,7 @@ ``[link asio.reference.basic_signal_set.basic_signal_set.overload2 basic_signal_set]``( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload2 more...]]`` @@ -25699,7 +26040,7 @@ ``[link asio.reference.basic_signal_set.basic_signal_set.overload3 basic_signal_set]``( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1, int signal_number_2); `` [''''»''' [link asio.reference.basic_signal_set.basic_signal_set.overload3 more...]]`` @@ -25709,7 +26050,7 @@ ``[link asio.reference.basic_signal_set.basic_signal_set.overload4 basic_signal_set]``( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1, int signal_number_2, int signal_number_3); @@ -25723,7 +26064,7 @@ basic_signal_set( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a signal set without registering for any signals. @@ -25734,7 +26075,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set. ]] ] @@ -25752,7 +26093,7 @@ basic_signal_set( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1); @@ -25764,7 +26105,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] [[signal_number_1][The signal number to be added.]] @@ -25775,7 +26116,7 @@ This constructor is equivalent to performing: - asio::signal_set signals(io_service); + asio::signal_set signals(io_context); signals.add(signal_number_1); @@ -25795,7 +26136,7 @@ basic_signal_set( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1, int signal_number_2); @@ -25808,7 +26149,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] [[signal_number_1][The first signal number to be added.]] @@ -25821,7 +26162,7 @@ This constructor is equivalent to performing: - asio::signal_set signals(io_service); + asio::signal_set signals(io_context); signals.add(signal_number_1); signals.add(signal_number_2); @@ -25842,7 +26183,7 @@ basic_signal_set( - asio::io_service & io_service, + asio::io_context & io_context, int signal_number_1, int signal_number_2, int signal_number_3); @@ -25856,7 +26197,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the signal set will use to dispatch handlers for any asynchronous operations performed on the set.]] [[signal_number_1][The first signal number to be added.]] @@ -25871,7 +26212,7 @@ This constructor is equivalent to performing: - asio::signal_set signals(io_service); + asio::signal_set signals(io_context); signals.add(signal_number_1); signals.add(signal_number_2); signals.add(signal_number_3); @@ -26077,7 +26418,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -26085,38 +26426,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -26126,12 +26467,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -26214,24 +26555,50 @@ [endsect] +[section:get_io_context basic_signal_set::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_signal_set] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_signal_set::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_signal_set] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -26680,8 +27047,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -26917,7 +27289,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -26936,7 +27308,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -26980,7 +27352,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -26999,7 +27371,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -27183,7 +27555,7 @@ explicit ``[link asio.reference.basic_socket.basic_socket.overload1 basic_socket]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload1 more...]]`` @@ -27191,7 +27563,7 @@ ``[link asio.reference.basic_socket.basic_socket.overload2 basic_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload2 more...]]`` @@ -27200,7 +27572,7 @@ ``[link asio.reference.basic_socket.basic_socket.overload3 basic_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload3 more...]]`` @@ -27209,7 +27581,7 @@ ``[link asio.reference.basic_socket.basic_socket.overload4 basic_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); `` [''''»''' [link asio.reference.basic_socket.basic_socket.overload4 more...]]`` @@ -27242,7 +27614,7 @@ basic_socket( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a socket without opening it. @@ -27253,7 +27625,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] ] @@ -27271,7 +27643,7 @@ basic_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -27283,7 +27655,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -27313,7 +27685,7 @@ basic_socket( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); @@ -27325,7 +27697,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[endpoint][An endpoint on the local machine to which the socket will be bound.]] @@ -27355,7 +27727,7 @@ basic_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); @@ -27368,7 +27740,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -27418,7 +27790,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -27456,7 +27828,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -27519,7 +27891,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -27564,7 +27936,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -27606,7 +27978,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -27617,7 +27989,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -27660,7 +28032,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -27866,7 +28238,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -27946,7 +28318,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.connect(endpoint); @@ -27993,7 +28365,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -28035,7 +28407,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -28046,7 +28418,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -28089,7 +28461,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -28100,7 +28472,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -28143,7 +28515,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -28154,7 +28526,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -28207,7 +28579,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -28215,38 +28587,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -28256,12 +28628,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -28344,24 +28716,50 @@ [endsect] +[section:get_io_context basic_socket::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_socket] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_socket::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -28429,7 +28827,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -28478,7 +28876,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -28632,7 +29030,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -28681,7 +29079,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -28738,7 +29136,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -28749,7 +29147,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -28792,7 +29190,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -28803,7 +29201,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -28871,7 +29269,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -28917,7 +29315,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -29241,8 +29639,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -30067,7 +30470,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -30110,7 +30513,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -30176,7 +30579,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -30213,7 +30616,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -30265,7 +30668,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -30276,7 +30679,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -30319,7 +30722,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -30330,7 +30733,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -30397,7 +30800,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -30443,7 +30846,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -30484,7 +30887,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -30495,7 +30898,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -30538,7 +30941,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -30549,7 +30952,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -30592,7 +30995,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -30603,7 +31006,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -30709,7 +31112,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -30757,7 +31160,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -30831,7 +31234,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -30875,7 +31278,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -30979,7 +31382,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -31023,7 +31426,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -31328,8 +31731,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -31461,7 +31869,7 @@ Opening a socket acceptor with the SO\_REUSEADDR option enabled: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); @@ -31521,8 +31929,44 @@ asio::error_code & ec); `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload4 more...]]`` + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload5 accept]``(); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload5 more...]]`` -[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)] + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload6 accept]``( + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload6 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload7 accept]``( + asio::io_context & io_context); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload7 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload8 accept]``( + asio::io_context & io_context, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload8 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload9 accept]``( + endpoint_type & peer_endpoint); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload9 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload10 accept]``( + endpoint_type & peer_endpoint, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload10 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload11 accept]``( + asio::io_context & io_context, + endpoint_type & peer_endpoint); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload11 more...]]`` + + Protocol::socket ``[link asio.reference.basic_socket_acceptor.accept.overload12 accept]``( + asio::io_context & io_context, + endpoint_type & peer_endpoint, + asio::error_code & ec); + `` [''''»''' [link asio.reference.basic_socket_acceptor.accept.overload12 more...]]`` + + +[section:overload1 basic_socket_acceptor::accept (1 of 12 overloads)] Accept a new connection. @@ -31563,9 +32007,9 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); acceptor.accept(socket); @@ -31578,7 +32022,7 @@ -[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)] +[section:overload2 basic_socket_acceptor::accept (2 of 12 overloads)] Accept a new connection. @@ -31612,9 +32056,9 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... - asio::ip::tcp::soocket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; acceptor.accept(socket, ec); if (ec) @@ -31632,7 +32076,7 @@ -[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)] +[section:overload3 basic_socket_acceptor::accept (3 of 12 overloads)] Accept a new connection and obtain the endpoint of the peer. @@ -31674,9 +32118,9 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint; acceptor.accept(socket, endpoint); @@ -31690,7 +32134,7 @@ -[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)] +[section:overload4 basic_socket_acceptor::accept (4 of 12 overloads)] Accept a new connection and obtain the endpoint of the peer. @@ -31725,9 +32169,9 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint; asio::error_code ec; acceptor.accept(socket, endpoint, ec); @@ -31745,6 +32189,456 @@ [endsect] + +[section:overload5 basic_socket_acceptor::accept (5 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept(); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Return Value] + +A socket object representing the newly accepted connection. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::socket socket(acceptor.accept()); + + + + + + + +[endsect] + + + +[section:overload6 basic_socket_acceptor::accept (6 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + asio::error_code & ec); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +On success, a socket object representing the newly accepted connection. On error, a socket object where `is_open()` is false. + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::socket socket(acceptor.accept(ec)); + if (ec) + { + // An error occurred. + } + + + + + + + +[endsect] + + + +[section:overload7 basic_socket_acceptor::accept (7 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + asio::io_context & io_context); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +] + + +[heading Return Value] + +A socket object representing the newly accepted connection. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::socket socket(acceptor.accept()); + + + + + + + +[endsect] + + + +[section:overload8 basic_socket_acceptor::accept (8 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + asio::io_context & io_context, + asio::error_code & ec); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +On success, a socket object representing the newly accepted connection. On error, a socket object where `is_open()` is false. + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::socket socket(acceptor.accept(io_context2, ec)); + if (ec) + { + // An error occurred. + } + + + + + + + +[endsect] + + + +[section:overload9 basic_socket_acceptor::accept (9 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + endpoint_type & peer_endpoint); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written.]] + +] + + +[heading Return Value] + +A socket object representing the newly accepted connection. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket(acceptor.accept(endpoint)); + + + + + + + +[endsect] + + + +[section:overload10 basic_socket_acceptor::accept (10 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + endpoint_type & peer_endpoint, + asio::error_code & ec); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +On success, a socket object representing the newly accepted connection. On error, a socket object where `is_open()` is false. + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket(acceptor.accept(endpoint, ec)); + if (ec) + { + // An error occurred. + } + + + + + + + +[endsect] + + + +[section:overload11 basic_socket_acceptor::accept (11 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + asio::io_context & io_context, + endpoint_type & peer_endpoint); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written.]] + +] + + +[heading Return Value] + +A socket object representing the newly accepted connection. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket( + acceptor.accept(io_context2, endpoint)); + + + + + + + +[endsect] + + + +[section:overload12 basic_socket_acceptor::accept (12 of 12 overloads)] + + +Accept a new connection. + + + Protocol::socket accept( + asio::io_context & io_context, + endpoint_type & peer_endpoint, + asio::error_code & ec); + + +This function is used to accept a new connection from a peer. The function call will block until a new connection has been accepted successfully or an error occurs. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +On success, a socket object representing the newly accepted connection. On error, a socket object where `is_open()` is false. + + +[heading Example] + + + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + asio::ip::tcp::socket socket( + acceptor.accept(io_context2, endpoint, ec)); + if (ec) + { + // An error occurred. + } + + + + + + + +[endsect] + + [endsect] [section:assign basic_socket_acceptor::assign] @@ -31824,8 +32718,36 @@ AcceptHandler && handler); `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload2 more...]]`` + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload3 async_accept]``( + MoveAcceptHandler && handler); + `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload3 more...]]`` -[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)] + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload4 async_accept]``( + asio::io_context & io_context, + MoveAcceptHandler && handler); + `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload4 more...]]`` + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload5 async_accept]``( + endpoint_type & peer_endpoint, + MoveAcceptHandler && handler); + `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload5 more...]]`` + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.basic_socket_acceptor.async_accept.overload6 async_accept]``( + asio::io_context & io_context, + endpoint_type & peer_endpoint, + MoveAcceptHandler && handler); + `` [''''»''' [link asio.reference.basic_socket_acceptor.async_accept.overload6 more...]]`` + + +[section:overload1 basic_socket_acceptor::async_accept (1 of 6 overloads)] Start an asynchronous accept. @@ -31857,7 +32779,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -31876,9 +32798,9 @@ ... - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); acceptor.async_accept(socket, accept_handler); @@ -31891,7 +32813,7 @@ -[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)] +[section:overload2 basic_socket_acceptor::async_accept (2 of 6 overloads)] Start an asynchronous accept. @@ -31924,7 +32846,7 @@ 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()`. ]] +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_context::post()`. ]] ] @@ -31934,6 +32856,272 @@ [endsect] + +[section:overload3 basic_socket_acceptor::async_accept (3 of 6 overloads)] + + +Start an asynchronous accept. + + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_accept( + MoveAcceptHandler && handler); + + +This function is used to asynchronously accept a new connection. The function call always returns immediately. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[handler][The handler to be called when the accept 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. + typename Protocol::socket peer // On success, the newly accepted socket. + ); +`` +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_context::post()`.]] + +] + + +[heading Example] + + + + void accept_handler(const asio::error_code& error, + asio::ip::tcp::socket peer) + { + if (!error) + { + // Accept succeeded. + } + } + + ... + + asio::ip::tcp::acceptor acceptor(io_context); + ... + acceptor.async_accept(accept_handler); + + + + + + + +[endsect] + + + +[section:overload4 basic_socket_acceptor::async_accept (4 of 6 overloads)] + + +Start an asynchronous accept. + + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_accept( + asio::io_context & io_context, + MoveAcceptHandler && handler); + + +This function is used to asynchronously accept a new connection. The function call always returns immediately. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +[[handler][The handler to be called when the accept 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. + typename Protocol::socket peer // On success, the newly accepted socket. + ); +`` +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_context::post()`.]] + +] + + +[heading Example] + + + + void accept_handler(const asio::error_code& error, + asio::ip::tcp::socket peer) + { + if (!error) + { + // Accept succeeded. + } + } + + ... + + asio::ip::tcp::acceptor acceptor(io_context); + ... + acceptor.async_accept(io_context2, accept_handler); + + + + + + + +[endsect] + + + +[section:overload5 basic_socket_acceptor::async_accept (5 of 6 overloads)] + + +Start an asynchronous accept. + + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_accept( + endpoint_type & peer_endpoint, + MoveAcceptHandler && handler); + + +This function is used to asynchronously accept a new connection. The function call always returns immediately. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written. Ownership of the peer\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]] + +[[handler][The handler to be called when the accept 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. + typename Protocol::socket peer // On success, the newly accepted socket. + ); +`` +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_context::post()`.]] + +] + + +[heading Example] + + + + void accept_handler(const asio::error_code& error, + asio::ip::tcp::socket peer) + { + if (!error) + { + // Accept succeeded. + } + } + + ... + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + acceptor.async_accept(endpoint, accept_handler); + + + + + + + +[endsect] + + + +[section:overload6 basic_socket_acceptor::async_accept (6 of 6 overloads)] + + +Start an asynchronous accept. + + + template< + typename ``[link asio.reference.MoveAcceptHandler MoveAcceptHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_accept( + asio::io_context & io_context, + endpoint_type & peer_endpoint, + MoveAcceptHandler && handler); + + +This function is used to asynchronously accept a new connection. The function call always returns immediately. + +This overload requires that the Protocol template parameter satisfy the AcceptableProtocol type requirements. + + +[heading Parameters] + + +[variablelist + +[[io_context][The [link asio.reference.io_context `io_context`] object to be used for the newly accepted socket.]] + +[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written. Ownership of the peer\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]] + +[[handler][The handler to be called when the accept 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. + typename Protocol::socket peer // On success, the newly accepted socket. + ); +`` +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_context::post()`.]] + +] + + +[heading Example] + + + + void accept_handler(const asio::error_code& error, + asio::ip::tcp::socket peer) + { + if (!error) + { + // Accept succeeded. + } + } + + ... + + asio::ip::tcp::acceptor acceptor(io_context); + ... + asio::ip::tcp::endpoint endpoint; + acceptor.async_accept(io_context2, endpoint, accept_handler); + + + + + + + +[endsect] + + [endsect] @@ -31966,7 +33154,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -31985,7 +33173,7 @@ ... - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... acceptor.async_wait( asio::ip::tcp::acceptor::wait_read, @@ -32007,7 +33195,7 @@ explicit ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 more...]]`` @@ -32015,7 +33203,7 @@ ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 more...]]`` @@ -32024,7 +33212,7 @@ ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 basic_socket_acceptor]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint, bool reuse_addr = true); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 more...]]`` @@ -32034,7 +33222,7 @@ ``[link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 basic_socket_acceptor]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_acceptor); `` [''''»''' [link asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 more...]]`` @@ -32067,7 +33255,7 @@ basic_socket_acceptor( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates an acceptor without opening it to listen for new connections. The `open()` function must be called before the acceptor can accept new socket connections. @@ -32078,7 +33266,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]] ] @@ -32096,7 +33284,7 @@ basic_socket_acceptor( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -32108,7 +33296,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -32138,7 +33326,7 @@ basic_socket_acceptor( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint, bool reuse_addr = true); @@ -32151,7 +33339,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] [[endpoint][An endpoint on the local machine on which the acceptor will listen for new connections.]] @@ -32174,7 +33362,7 @@ This constructor is equivalent to the following code: - basic_socket_acceptor<Protocol> acceptor(io_service); + basic_socket_acceptor<Protocol> acceptor(io_context); acceptor.open(endpoint.protocol()); if (reuse_addr) acceptor.set_option(socket_base::reuse_address(true)); @@ -32198,7 +33386,7 @@ basic_socket_acceptor( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_acceptor); @@ -32211,7 +33399,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -32261,7 +33449,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket_acceptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket_acceptor(io_context&) constructor`. @@ -32299,7 +33487,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -32362,7 +33550,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); acceptor.open(endpoint.protocol()); acceptor.bind(endpoint); @@ -32407,7 +33595,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), 12345); acceptor.open(endpoint.protocol()); asio::error_code ec; @@ -32449,7 +33637,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -32460,7 +33648,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -32503,7 +33691,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -32670,7 +33858,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::error_code ec; acceptor.close(ec); @@ -32711,7 +33899,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -32722,7 +33910,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -32765,7 +33953,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -32776,7 +33964,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -32819,7 +34007,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -32830,7 +34018,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -32883,7 +34071,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -32891,38 +34079,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -32932,12 +34120,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -33020,24 +34208,50 @@ [endsect] +[section:get_io_context basic_socket_acceptor::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_socket_acceptor] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_socket_acceptor::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket_acceptor] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -33105,7 +34319,7 @@ Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::reuse_address option; acceptor.get_option(option); @@ -33154,7 +34368,7 @@ Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::reuse_address option; asio::error_code ec; @@ -33308,7 +34522,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::non_blocking_io command(true); socket.io_control(command); @@ -33356,7 +34570,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::non_blocking_io command(true); asio::error_code ec; @@ -33412,7 +34626,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -33423,7 +34637,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -33466,7 +34680,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -33477,7 +34691,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -33585,7 +34799,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::error_code ec; acceptor.listen(asio::socket_base::max_connections, ec); @@ -33650,7 +34864,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); @@ -33696,7 +34910,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec); @@ -34165,7 +35379,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); acceptor.open(asio::ip::tcp::v4()); @@ -34208,7 +35422,7 @@ - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::error_code ec; acceptor.open(asio::ip::tcp::v4(), ec); if (ec) @@ -34274,7 +35488,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket_acceptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket_acceptor(io_context&) constructor`. @@ -34311,7 +35525,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_socket(io_context&) constructor`. @@ -34363,7 +35577,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -34374,7 +35588,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -34417,7 +35631,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -34428,7 +35642,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -34471,7 +35685,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -34482,7 +35696,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -34525,7 +35739,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -34536,7 +35750,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -34579,7 +35793,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -34590,7 +35804,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -34696,7 +35910,7 @@ Setting the SOL\_SOCKET/SO\_REUSEADDR option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::reuse_address option(true); acceptor.set_option(option); @@ -34744,7 +35958,7 @@ Setting the SOL\_SOCKET/SO\_REUSEADDR option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::ip::tcp::acceptor::reuse_address option(true); asio::error_code ec; @@ -34849,7 +36063,7 @@ Waiting for an acceptor to become readable. - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... acceptor.wait(asio::ip::tcp::acceptor::wait_read); @@ -34893,7 +36107,7 @@ Waiting for an acceptor to become readable. - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::error_code ec; acceptor.wait(asio::ip::tcp::acceptor::wait_read, ec); @@ -35812,8 +37026,13 @@ ] [ + [[link asio.reference.basic_socket_streambuf.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_streambuf.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -36086,7 +37305,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -36105,7 +37324,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -36152,7 +37371,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -36171,7 +37390,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -36430,7 +37649,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -36478,7 +37697,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -36520,7 +37739,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -36531,7 +37750,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -36574,7 +37793,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -36781,7 +38000,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -36925,7 +38144,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -36967,7 +38186,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -36978,7 +38197,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -37021,7 +38240,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -37032,7 +38251,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -37117,7 +38336,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -37128,7 +38347,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -37202,7 +38421,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -37210,38 +38429,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -37251,12 +38470,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -37564,24 +38783,50 @@ [endsect] +[section:get_io_context basic_socket_streambuf::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_socket_streambuf] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_socket_streambuf::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_socket_streambuf] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -37648,7 +38893,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -37700,7 +38945,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -37853,7 +39098,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -37905,7 +39150,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -37983,7 +39228,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -37994,7 +39239,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -38037,7 +39282,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -38048,7 +39293,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -38119,7 +39364,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -38168,7 +39413,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -38501,8 +39746,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -39354,7 +40604,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -39400,7 +40650,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -39498,7 +40748,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -39509,7 +40759,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -39552,7 +40802,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -39563,7 +40813,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -39633,7 +40883,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -39682,7 +40932,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -39723,7 +40973,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -39734,7 +40984,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -39777,7 +41027,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -39788,7 +41038,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -39831,7 +41081,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -39842,7 +41092,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -39947,7 +41197,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -39998,7 +41248,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -40089,7 +41339,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -40136,7 +41386,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -40327,7 +41577,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -40374,7 +41624,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -40713,8 +41963,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -40977,7 +42232,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -40996,7 +42251,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.async_connect(endpoint, connect_handler); @@ -41042,7 +42297,7 @@ std::size_t bytes_transferred // Number of bytes read. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41122,7 +42377,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41182,7 +42437,7 @@ std::size_t bytes_transferred // Number of bytes received. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41264,7 +42519,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41324,7 +42579,7 @@ std::size_t bytes_transferred // Number of bytes sent. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41384,7 +42639,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -41403,7 +42658,7 @@ ... - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.async_wait(asio::ip::tcp::socket::wait_read, wait_handler); @@ -41448,7 +42703,7 @@ std::size_t bytes_transferred // Number of bytes written. ); `` -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()`.]] +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_context::post()`.]] ] @@ -41656,7 +42911,7 @@ explicit ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload1 basic_stream_socket]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload1 more...]]`` @@ -41664,7 +42919,7 @@ ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload2 more...]]`` @@ -41673,7 +42928,7 @@ ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload3 more...]]`` @@ -41682,7 +42937,7 @@ ``[link asio.reference.basic_stream_socket.basic_stream_socket.overload4 basic_stream_socket]``( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); `` [''''»''' [link asio.reference.basic_stream_socket.basic_stream_socket.overload4 more...]]`` @@ -41715,7 +42970,7 @@ basic_stream_socket( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a stream socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it. @@ -41726,7 +42981,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]] ] @@ -41744,7 +42999,7 @@ basic_stream_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol); @@ -41756,7 +43011,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -41786,7 +43041,7 @@ basic_stream_socket( - asio::io_service & io_service, + asio::io_context & io_context, const endpoint_type & endpoint); @@ -41798,7 +43053,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[endpoint][An endpoint on the local machine to which the stream socket will be bound.]] @@ -41828,7 +43083,7 @@ basic_stream_socket( - asio::io_service & io_service, + asio::io_context & io_context, const protocol_type & protocol, const native_handle_type & native_socket); @@ -41841,7 +43096,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]] [[protocol][An object specifying protocol parameters to be used.]] @@ -41891,7 +43146,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_context&) constructor`. @@ -41929,7 +43184,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_context&) constructor`. @@ -41995,7 +43250,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); socket.bind(asio::ip::tcp::endpoint( asio::ip::tcp::v4(), 12345)); @@ -42043,7 +43298,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); asio::error_code ec; socket.bind(asio::ip::tcp::endpoint( @@ -42085,7 +43340,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -42096,7 +43351,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -42139,7 +43394,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -42357,7 +43612,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.close(ec); @@ -42440,7 +43695,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); socket.connect(endpoint); @@ -42490,7 +43745,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::ip::tcp::endpoint endpoint( asio::ip::address::from_string("1.2.3.4"), 12345); asio::error_code ec; @@ -42532,7 +43787,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -42543,7 +43798,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -42586,7 +43841,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -42597,7 +43852,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -42640,7 +43895,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -42651,7 +43906,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -42704,7 +43959,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -42712,38 +43967,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -42753,12 +44008,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -42841,24 +44096,50 @@ [endsect] +[section:get_io_context basic_stream_socket::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_stream_socket] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_stream_socket::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_stream_socket] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -42925,7 +44206,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; socket.get_option(option); @@ -42977,7 +44258,7 @@ Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::keep_alive option; asio::error_code ec; @@ -43130,7 +44411,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; socket.io_control(command); @@ -43182,7 +44463,7 @@ Getting the number of bytes ready to read: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::socket::bytes_readable command; asio::error_code ec; @@ -43242,7 +44523,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -43253,7 +44534,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -43296,7 +44577,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -43307,7 +44588,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -43378,7 +44659,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); @@ -43427,7 +44708,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec); @@ -43760,8 +45041,13 @@ ] [ + [[link asio.reference.basic_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -44610,7 +45896,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); socket.open(asio::ip::tcp::v4()); @@ -44656,7 +45942,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); asio::error_code ec; socket.open(asio::ip::tcp::v4(), ec); if (ec) @@ -44722,7 +46008,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_context&) constructor`. @@ -44759,7 +46045,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_socket(io_context&) constructor`. @@ -45142,7 +46428,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -45153,7 +46439,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -45196,7 +46482,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -45207,7 +46493,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -45277,7 +46563,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); @@ -45326,7 +46612,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec); @@ -45367,7 +46653,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -45378,7 +46664,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -45622,7 +46908,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -45633,7 +46919,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -45676,7 +46962,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -45687,7 +46973,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -45792,7 +47078,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -45843,7 +47129,7 @@ Setting the IPPROTO\_TCP/TCP\_NODELAY option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); asio::error_code ec; @@ -45920,7 +47206,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.shutdown(asio::ip::tcp::socket::shutdown_send); @@ -45967,7 +47253,7 @@ Shutting down the send side of the socket: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.shutdown(asio::ip::tcp::socket::shutdown_send, ec); @@ -46074,7 +47360,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... socket.wait(asio::ip::tcp::socket::wait_read); @@ -46121,7 +47407,7 @@ Waiting for a socket to become readable. - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::error_code ec; socket.wait(asio::ip::tcp::socket::wait_read, ec); @@ -47496,8 +48782,13 @@ ] [ + [[link asio.reference.basic_waitable_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -47552,7 +48843,7 @@ Performing a blocking wait (C++11): // Construct a timer without setting an expiry time. - asio::steady_timer timer(io_service); + asio::steady_timer timer(io_context); // Set an expiry time relative to now. timer.expires_after(std::chrono::seconds(5)); @@ -47577,7 +48868,7 @@ ... // Construct a timer with an absolute expiry time. - asio::steady_timer timer(io_service, + asio::steady_timer timer(io_context, std::chrono::steady_clock::now() + std::chrono::seconds(60)); // Start an asynchronous wait. @@ -47668,7 +48959,7 @@ 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()`. ]] +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_context::post()`. ]] ] @@ -47685,7 +48976,7 @@ explicit ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload1 basic_waitable_timer]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload1 more...]]`` @@ -47693,7 +48984,7 @@ ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload2 basic_waitable_timer]``( - asio::io_service & io_service, + asio::io_context & io_context, const time_point & expiry_time); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload2 more...]]`` @@ -47702,7 +48993,7 @@ ``[link asio.reference.basic_waitable_timer.basic_waitable_timer.overload3 basic_waitable_timer]``( - asio::io_service & io_service, + asio::io_context & io_context, const duration & expiry_time); `` [''''»''' [link asio.reference.basic_waitable_timer.basic_waitable_timer.overload3 more...]]`` @@ -47722,7 +49013,7 @@ basic_waitable_timer( - asio::io_service & io_service); + asio::io_context & io_context); 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. @@ -47733,7 +49024,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer. ]] ] @@ -47751,7 +49042,7 @@ basic_waitable_timer( - asio::io_service & io_service, + asio::io_context & io_context, const time_point & expiry_time); @@ -47763,7 +49054,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] [[expiry_time][The expiry time to be used for the timer, expressed as an absolute time. ]] @@ -47783,7 +49074,7 @@ basic_waitable_timer( - asio::io_service & io_service, + asio::io_context & io_context, const duration & expiry_time); @@ -47795,7 +49086,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the timer will use to dispatch handlers for any asynchronous operations performed on the timer.]] [[expiry_time][The expiry time to be used for the timer, relative to now. ]] @@ -47833,7 +49124,7 @@ [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`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_waitable_timer(io_context&) constructor`. @@ -48111,7 +49402,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -48119,38 +49410,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -48160,12 +49451,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -48670,24 +49961,50 @@ [endsect] +[section:get_io_context basic_waitable_timer::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..basic_waitable_timer] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service basic_waitable_timer::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..basic_waitable_timer] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -48793,7 +50110,7 @@ [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`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_waitable_timer(io_context&) constructor`. @@ -49179,6 +50496,78 @@ [endsect] +[section:bind_executor bind_executor] + +[indexterm1 bind_executor] +Associate an object of type `T` with an executor of type `Executor`. + + + template< + typename ``[link asio.reference.Executor1 Executor]``, + typename T> + executor_binder< typename decay< T >::type, Executor > ``[link asio.reference.bind_executor.overload1 bind_executor]``( + const Executor & ex, + T && t, + typename enable_if< is_executor< Executor >::value >::type * = 0); + `` [''''»''' [link asio.reference.bind_executor.overload1 more...]]`` + + template< + typename ExecutionContext, + typename T> + executor_binder< typename decay< T >::type, typename ExecutionContext::executor_type > ``[link asio.reference.bind_executor.overload2 bind_executor]``( + ExecutionContext & ctx, + T && t, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + `` [''''»''' [link asio.reference.bind_executor.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^asio/bind_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:overload1 bind_executor (1 of 2 overloads)] + + +Associate an object of type `T` with an executor of type `Executor`. + + + template< + typename ``[link asio.reference.Executor1 Executor]``, + typename T> + executor_binder< typename decay< T >::type, Executor > bind_executor( + const Executor & ex, + T && t, + typename enable_if< is_executor< Executor >::value >::type * = 0); + + + +[endsect] + + + +[section:overload2 bind_executor (2 of 2 overloads)] + + +Associate an object of type `T` with an execution context's executor. + + + template< + typename ExecutionContext, + typename T> + executor_binder< typename decay< T >::type, typename ExecutionContext::executor_type > bind_executor( + ExecutionContext & ctx, + T && t, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); + + + +[endsect] + + +[endsect] + [section:buffer buffer] [indexterm1 buffer] @@ -52568,8 +53957,13 @@ ] [ + [[link asio.reference.buffered_read_stream.get_io_context [*get_io_context]]] + [Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.buffered_read_stream.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_io_context().) Get the io_context associated with the object. ] ] [ @@ -52859,13 +54253,27 @@ [endsect] +[section:get_io_context buffered_read_stream::get_io_context] + +[indexterm2 get_io_context..buffered_read_stream] +Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service buffered_read_stream::get_io_service] [indexterm2 get_io_service..buffered_read_stream] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_io_context()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -53282,8 +54690,13 @@ ] [ + [[link asio.reference.buffered_stream.get_io_context [*get_io_context]]] + [Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.buffered_stream.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_io_context().) Get the io_context associated with the object. ] ] [ @@ -53615,13 +55028,27 @@ [endsect] +[section:get_io_context buffered_stream::get_io_context] + +[indexterm2 get_io_context..buffered_stream] +Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service buffered_stream::get_io_service] [indexterm2 get_io_service..buffered_stream] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_io_context()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -54026,8 +55453,13 @@ ] [ + [[link asio.reference.buffered_write_stream.get_io_context [*get_io_context]]] + [Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.buffered_write_stream.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [(Deprecated: Use get_io_context().) Get the io_context associated with the object. ] ] [ @@ -54317,13 +55749,27 @@ [endsect] +[section:get_io_context buffered_write_stream::get_io_context] + +[indexterm2 get_io_context..buffered_write_stream] +Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service buffered_write_stream::get_io_service] [indexterm2 get_io_service..buffered_write_stream] -Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_io_context()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -55460,20 +56906,22 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator> - Iterator ``[link asio.reference.connect.overload1 connect]``( + typename ``[link asio.reference.EndpointSequence EndpointSequence]``> + Protocol::endpoint ``[link asio.reference.connect.overload1 connect]``( basic_socket< Protocol, SocketService > & s, - Iterator begin); + const EndpointSequence & endpoints, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.connect.overload1 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator> - Iterator ``[link asio.reference.connect.overload2 connect]``( + typename ``[link asio.reference.EndpointSequence EndpointSequence]``> + Protocol::endpoint ``[link asio.reference.connect.overload2 connect]``( basic_socket< Protocol, SocketService > & s, - Iterator begin, - asio::error_code & ec); + const EndpointSequence & endpoints, + asio::error_code & ec, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.connect.overload2 more...]]`` template< @@ -55483,7 +56931,7 @@ Iterator ``[link asio.reference.connect.overload3 connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - Iterator end); + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); `` [''''»''' [link asio.reference.connect.overload3 more...]]`` template< @@ -55493,57 +56941,105 @@ Iterator ``[link asio.reference.connect.overload4 connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - Iterator end, - asio::error_code & ec); + asio::error_code & ec, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); `` [''''»''' [link asio.reference.connect.overload4 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, - typename ConnectCondition> + typename Iterator> Iterator ``[link asio.reference.connect.overload5 connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - ConnectCondition connect_condition); + Iterator end); `` [''''»''' [link asio.reference.connect.overload5 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, - typename ConnectCondition> + typename Iterator> Iterator ``[link asio.reference.connect.overload6 connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, - ConnectCondition connect_condition, + Iterator end, asio::error_code & ec); `` [''''»''' [link asio.reference.connect.overload6 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ConnectCondition> - Iterator ``[link asio.reference.connect.overload7 connect]``( + Protocol::endpoint ``[link asio.reference.connect.overload7 connect]``( basic_socket< Protocol, SocketService > & s, - Iterator begin, - Iterator end, - ConnectCondition connect_condition); + const EndpointSequence & endpoints, + ConnectCondition connect_condition, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); `` [''''»''' [link asio.reference.connect.overload7 more...]]`` template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, + typename ConnectCondition> + Protocol::endpoint ``[link asio.reference.connect.overload8 connect]``( + basic_socket< Protocol, SocketService > & s, + const EndpointSequence & endpoints, + ConnectCondition connect_condition, + asio::error_code & ec, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); + `` [''''»''' [link asio.reference.connect.overload8 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, typename Iterator, typename ConnectCondition> - Iterator ``[link asio.reference.connect.overload8 connect]``( + Iterator ``[link asio.reference.connect.overload9 connect]``( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + `` [''''»''' [link asio.reference.connect.overload9 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition> + Iterator ``[link asio.reference.connect.overload10 connect]``( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + asio::error_code & ec, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + `` [''''»''' [link asio.reference.connect.overload10 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition> + Iterator ``[link asio.reference.connect.overload11 connect]``( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + Iterator end, + ConnectCondition connect_condition); + `` [''''»''' [link asio.reference.connect.overload11 more...]]`` + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition> + Iterator ``[link asio.reference.connect.overload12 connect]``( basic_socket< Protocol, SocketService > & s, Iterator begin, Iterator end, ConnectCondition connect_condition, asio::error_code & ec); - `` [''''»''' [link asio.reference.connect.overload8 more...]]`` + `` [''''»''' [link asio.reference.connect.overload12 more...]]`` [heading Requirements] @@ -55552,7 +57048,7 @@ ['Convenience header: ][^asio.hpp] -[section:overload1 connect (1 of 8 overloads)] +[section:overload1 connect (1 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55561,10 +57057,11 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator> - Iterator connect( + typename ``[link asio.reference.EndpointSequence EndpointSequence]``> + Protocol::endpoint connect( basic_socket< Protocol, SocketService > & s, - Iterator begin); + const EndpointSequence & endpoints, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -55577,14 +57074,14 @@ [[s][The socket to be connected. If the socket is already open, it will be closed.]] -[[begin][An iterator pointing to the start of a sequence of endpoints.]] +[[endpoints][A sequence of endpoints.]] ] [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. +The successfully connected endpoint. [heading Exceptions] @@ -55597,18 +57094,13 @@ ] -[heading Remarks] - -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. - - [heading Example] - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); + tcp::socket s(io_context); asio::connect(s, r.resolve(q)); @@ -55621,7 +57113,7 @@ -[section:overload2 connect (2 of 8 overloads)] +[section:overload2 connect (2 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55630,11 +57122,12 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator> - Iterator connect( + typename ``[link asio.reference.EndpointSequence EndpointSequence]``> + Protocol::endpoint connect( basic_socket< Protocol, SocketService > & s, - Iterator begin, - asio::error_code & ec); + const EndpointSequence & endpoints, + asio::error_code & ec, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -55647,7 +57140,7 @@ [[s][The socket to be connected. If the socket is already open, it will be closed.]] -[[begin][An iterator pointing to the start of a sequence of endpoints.]] +[[endpoints][A sequence of endpoints.]] [[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] @@ -55656,21 +57149,16 @@ [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. - - -[heading Remarks] - -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. +On success, the successfully connected endpoint. Otherwise, a default-constructed endpoint. [heading Example] - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); + tcp::socket s(io_context); asio::error_code ec; asio::connect(s, r.resolve(q), ec); if (ec) @@ -55688,7 +57176,114 @@ -[section:overload3 connect (3 of 8 overloads)] +[section:overload3 connect (3 of 12 overloads)] + + +(Deprecated.) Establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator> + Iterator connect( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[begin][An iterator pointing to the start of a sequence of endpoints.]] + +] + + +[heading Return Value] + +On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] + +] + + +[heading Remarks] + +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. + + + + +[endsect] + + + +[section:overload4 connect (4 of 12 overloads)] + + +(Deprecated.) Establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator> + Iterator connect( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + asio::error_code & ec, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[begin][An iterator pointing to the start of a sequence of endpoints.]] + +[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] + +] + + +[heading Return Value] + +On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. + + +[heading Remarks] + +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. + + + + +[endsect] + + + +[section:overload5 connect (5 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55723,7 +57318,7 @@ [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. +An iterator denoting the successfully connected endpoint. [heading Exceptions] @@ -55740,11 +57335,11 @@ - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::resolver::iterator i = r.resolve(q), end; - tcp::socket s(io_service); - asio::connect(s, i, end); + tcp::resolver::results_type e = r.resolve(q); + tcp::socket s(io_context); + asio::connect(s, e.begin(), e.end()); @@ -55756,7 +57351,7 @@ -[section:overload4 connect (4 of 8 overloads)] +[section:overload6 connect (6 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55801,12 +57396,12 @@ - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::resolver::iterator i = r.resolve(q), end; - tcp::socket s(io_service); + tcp::resolver::results_type e = r.resolve(q); + tcp::socket s(io_context); asio::error_code ec; - asio::connect(s, i, end, ec); + asio::connect(s, e.begin(), e.end(), ec); if (ec) { // An error occurred. @@ -55822,7 +57417,7 @@ -[section:overload5 connect (5 of 8 overloads)] +[section:overload7 connect (7 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55831,12 +57426,13 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ConnectCondition> - Iterator connect( + Protocol::endpoint connect( basic_socket< Protocol, SocketService > & s, - Iterator begin, - ConnectCondition connect_condition); + const EndpointSequence & endpoints, + ConnectCondition connect_condition, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -55849,22 +57445,22 @@ [[s][The socket to be connected. If the socket is already open, it will be closed.]] -[[begin][An iterator pointing to the start of a sequence of endpoints.]] +[[endpoints][A sequence of endpoints.]] [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] ] [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. +The successfully connected endpoint. [heading Exceptions] @@ -55877,37 +57473,31 @@ ] -[heading Remarks] - -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. - - [heading Example] The following connect condition function object can be used to output information about the individual connection attempts: struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); - tcp::resolver::iterator i = asio::connect( - s, r.resolve(q), my_connect_condition()); - std::cout << "Connected to: " << i->endpoint() << std::endl; + tcp::socket s(io_context); + tcp::endpoint e = asio::connect(s, + r.resolve(q), my_connect_condition()); + std::cout << "Connected to: " << e << std::endl; @@ -55919,7 +57509,7 @@ -[section:overload6 connect (6 of 8 overloads)] +[section:overload8 connect (8 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -55928,13 +57518,14 @@ template< typename ``[link asio.reference.Protocol Protocol]``, typename ``[link asio.reference.SocketService SocketService]``, - typename Iterator, + typename ``[link asio.reference.EndpointSequence EndpointSequence]``, typename ConnectCondition> - Iterator connect( + Protocol::endpoint connect( basic_socket< Protocol, SocketService > & s, - Iterator begin, + const EndpointSequence & endpoints, ConnectCondition connect_condition, - asio::error_code & ec); + asio::error_code & ec, + typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type * = 0); This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. @@ -55947,15 +57538,15 @@ [[s][The socket to be connected. If the socket is already open, it will be closed.]] -[[begin][An iterator pointing to the start of a sequence of endpoints.]] +[[endpoints][A sequence of endpoints.]] [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] [[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] @@ -55964,12 +57555,7 @@ [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. - - -[heading Remarks] - -This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. +On success, the successfully connected endpoint. Otherwise, a default-constructed endpoint. [heading Example] @@ -55978,33 +57564,32 @@ struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::socket s(io_service); + tcp::socket s(io_context); asio::error_code ec; - tcp::resolver::iterator i = asio::connect( - s, r.resolve(q), my_connect_condition(), ec); + tcp::endpoint e = asio::connect(s, + r.resolve(q), my_connect_condition(), ec); if (ec) { // An error occurred. } else { - std::cout << "Connected to: " << i->endpoint() << std::endl; + std::cout << "Connected to: " << e << std::endl; } @@ -56017,7 +57602,134 @@ -[section:overload7 connect (7 of 8 overloads)] +[section:overload9 connect (9 of 12 overloads)] + + +(Deprecated.) Establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition> + Iterator connect( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[begin][An iterator pointing to the start of a sequence of endpoints.]] + +[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: +`` + bool connect_condition( + const asio::error_code& ec, + const typename Protocol::endpoint& next); +`` +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] + +] + + +[heading Return Value] + +On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] + +] + + +[heading Remarks] + +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. + + + + +[endsect] + + + +[section:overload10 connect (10 of 12 overloads)] + + +(Deprecated.) Establishes a socket connection by trying each endpoint in a sequence. + + + template< + typename ``[link asio.reference.Protocol Protocol]``, + typename ``[link asio.reference.SocketService SocketService]``, + typename Iterator, + typename ConnectCondition> + Iterator connect( + basic_socket< Protocol, SocketService > & s, + Iterator begin, + ConnectCondition connect_condition, + asio::error_code & ec, + typename enable_if<!is_endpoint_sequence< Iterator >::value >::type * = 0); + + +This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established. + + +[heading Parameters] + + +[variablelist + +[[s][The socket to be connected. If the socket is already open, it will be closed.]] + +[[begin][An iterator pointing to the start of a sequence of endpoints.]] + +[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: +`` + bool connect_condition( + const asio::error_code& ec, + const typename Protocol::endpoint& next); +`` +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] + +[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] + +] + + +[heading Return Value] + +On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. + + +[heading Remarks] + +This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `asio::ip::tcp::resolver::iterator`. + + + + +[endsect] + + + +[section:overload11 connect (11 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -56051,18 +57763,18 @@ [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] ] [heading Return Value] -On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator. +An iterator denoting the successfully connected endpoint. [heading Exceptions] @@ -56081,25 +57793,25 @@ struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::resolver::iterator i = r.resolve(q), end; - tcp::socket s(io_service); - i = asio::connect(s, i, end, my_connect_condition()); + tcp::resolver::results_type e = r.resolve(q); + tcp::socket s(io_context); + tcp::resolver::results_type::iterator i = asio::connect( + s, e.begin(), e.end(), my_connect_condition()); std::cout << "Connected to: " << i->endpoint() << std::endl; @@ -56112,7 +57824,7 @@ -[section:overload8 connect (8 of 8 overloads)] +[section:overload12 connect (12 of 12 overloads)] Establishes a socket connection by trying each endpoint in a sequence. @@ -56147,11 +57859,11 @@ [[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be: `` - Iterator connect_condition( + bool connect_condition( const asio::error_code& ec, - Iterator next); + const typename Protocol::endpoint& next); `` -The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]] +The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is the next endpoint to be tried. The function object should return true if the next endpoint should be tried, and false if it should be skipped.]] [[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]] @@ -56169,26 +57881,26 @@ struct my_connect_condition { - template <typename Iterator> - Iterator operator()( + bool operator()( const asio::error_code& ec, - Iterator next) + const::tcp::endpoint& next) { if (ec) std::cout << "Error: " << ec.message() << std::endl; - std::cout << "Trying: " << next->endpoint() << std::endl; - return next; + std::cout << "Trying: " << next << std::endl; + return true; } }; It would be used with the `asio::connect` function as follows: - tcp::resolver r(io_service); + tcp::resolver r(io_context); tcp::resolver::query q("host", "service"); - tcp::resolver::iterator i = r.resolve(q), end; - tcp::socket s(io_service); + tcp::resolver::results_type e = r.resolve(q); + tcp::socket s(io_context); asio::error_code ec; - i = asio::connect(s, i, end, my_connect_condition(), ec); + tcp::resolver::results_type::iterator i = asio::connect( + s, e.begin(), e.end(), my_connect_condition()); if (ec) { // An error occurred. @@ -56960,7 +58672,7 @@ { do { - socket_.reset(new tcp::socket(io_service_)); + socket_.reset(new tcp::socket(io_context_)); yield acceptor->async_accept(*socket_, *this); fork server(*this)(); } while (is_parent()); @@ -56983,7 +58695,7 @@ The functions `is_parent()` and `is_child()` can be used to differentiate between parent and child. You would use these functions to alter subsequent control flow. -Note that `fork` doesn't do the actual forking by itself. It is the application's responsibility to create a clone of the coroutine and call it. The clone can be called immediately, as above, or scheduled for delayed execution using something like `io_service::post()`. +Note that `fork` doesn't do the actual forking by itself. It is the application's responsibility to create a clone of the coroutine and call it. The clone can be called immediately, as above, or scheduled for delayed execution using something like `io_context::post()`. [heading Alternate macro names] @@ -57075,7 +58787,7 @@ template< typename ``[link asio.reference.Protocol Protocol]``> class datagram_socket_service : - public io_service::service + public io_context::service [heading Types] @@ -57193,7 +58905,7 @@ [ [[link asio.reference.datagram_socket_service.datagram_socket_service [*datagram_socket_service]]] - [Construct a new datagram socket service for the specified io_service. ] + [Construct a new datagram socket service for the specified io_context. ] ] [ @@ -57202,8 +58914,13 @@ ] [ + [[link asio.reference.datagram_socket_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.datagram_socket_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -57595,11 +59312,11 @@ [section:datagram_socket_service datagram_socket_service::datagram_socket_service] [indexterm2 datagram_socket_service..datagram_socket_service] -Construct a new datagram socket service for the specified [link asio.reference.io_service `io_service`]. +Construct a new datagram socket service for the specified [link asio.reference.io_context `io_context`]. datagram_socket_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -57643,16 +59360,33 @@ +[section:get_io_context datagram_socket_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..datagram_socket_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service datagram_socket_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..datagram_socket_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -57685,7 +59419,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -58236,8 +59970,13 @@ ] [ + [[link asio.reference.basic_deadline_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -58282,7 +60021,7 @@ Performing a blocking wait: // Construct a timer without setting an expiry time. - asio::deadline_timer timer(io_service); + asio::deadline_timer timer(io_context); // Set an expiry time relative to now. timer.expires_from_now(boost::posix_time::seconds(5)); @@ -58307,7 +60046,7 @@ ... // Construct a timer with an absolute expiry time. - asio::deadline_timer timer(io_service, + asio::deadline_timer timer(io_context, boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); // Start an asynchronous wait. @@ -58378,7 +60117,7 @@ typename TimeType, typename ``[link asio.reference.TimeTraits TimeTraits]`` = asio::time_traits<TimeType>> class deadline_timer_service : - public io_service::service + public io_context::service [heading Types] @@ -58441,7 +60180,7 @@ [ [[link asio.reference.deadline_timer_service.deadline_timer_service [*deadline_timer_service]]] - [Construct a new timer service for the specified io_service. ] + [Construct a new timer service for the specified io_context. ] ] [ @@ -58464,8 +60203,13 @@ ] [ + [[link asio.reference.deadline_timer_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.deadline_timer_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -58559,11 +60303,11 @@ [section:deadline_timer_service deadline_timer_service::deadline_timer_service] [indexterm2 deadline_timer_service..deadline_timer_service] -Construct a new timer service for the specified [link asio.reference.io_service `io_service`]. +Construct a new timer service for the specified [link asio.reference.io_context `io_context`]. deadline_timer_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -58715,16 +60459,33 @@ [endsect] +[section:get_io_context deadline_timer_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..deadline_timer_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service deadline_timer_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..deadline_timer_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -58738,7 +60499,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -61400,7 +63161,7 @@ [ [[link asio.reference.execution_context__service [*service]]] - [Base class for all io_service services. ] + [Base class for all io_context services. ] ] @@ -61476,7 +63237,7 @@ ] -An execution context represents a place where function objects will be executed. An `io_service` is an example of an execution context. +An execution context represents a place where function objects will be executed. An `io_context` is an example of an execution context. [heading The execution_context class and services] @@ -61502,7 +63263,7 @@ -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. +Class [link asio.reference.execution_context `execution_context`] may be used only as a base class for concrete execution context types. The `io_context` 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()`. @@ -61512,7 +63273,7 @@ * 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. +* To shut down the whole program, the [link asio.reference.io_context `io_context`] function stop() is called to terminate any run() calls as soon as possible. The [link asio.reference.io_context `io_context`] destructor calls `shutdown_context()` and `destroy_context()` to destroy all pending handlers, causing all `shared_ptr` references to all connection objects to be destroyed. @@ -61846,7 +63607,7 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & ``[link asio.reference.execution_context.use_service.overload2 use_service]``( - io_service & ios); + io_context & ioc); `` [''''»''' [link asio.reference.execution_context.use_service.overload2 more...]]`` @@ -61901,10 +63662,10 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & use_service( - io_service & ios); + io_context & ioc); -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. +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_context `io_context`] will create a new instance of the service. [heading Parameters] @@ -61912,7 +63673,7 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] ] @@ -61924,7 +63685,7 @@ [heading Remarks] -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. @@ -62004,7 +63765,7 @@ [section:execution_context__service execution_context::service] -Base class for all [link asio.reference.io_service `io_service`] services. +Base class for all [link asio.reference.io_context `io_context`] services. class service : @@ -62971,238 +64732,16 @@ [endsect] -[section:executor_work executor_work] +[section:executor_binder executor_binder] -An object of type `executor_work` controls ownership of executor work within a scope. - - - template< - typename ``[link asio.reference.Executor1 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`. +A call wrapper type to bind an executor of type `Executor` to an object of type `T`. template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - class executor_wrapper + class executor_binder [heading Types] @@ -63211,43 +64750,43 @@ [ - [[link asio.reference.executor_wrapper.argument_type [*argument_type]]] + [[link asio.reference.executor_binder.argument_type [*argument_type]]] [The type of the function's argument. ] ] [ - [[link asio.reference.executor_wrapper.executor_type [*executor_type]]] + [[link asio.reference.executor_binder.executor_type [*executor_type]]] [The type of the associated executor. ] ] [ - [[link asio.reference.executor_wrapper.first_argument_type [*first_argument_type]]] + [[link asio.reference.executor_binder.first_argument_type [*first_argument_type]]] [The type of the function's first argument. ] ] [ - [[link asio.reference.executor_wrapper.result_type [*result_type]]] + [[link asio.reference.executor_binder.result_type [*result_type]]] [The return type if a function. ] ] [ - [[link asio.reference.executor_wrapper.second_argument_type [*second_argument_type]]] + [[link asio.reference.executor_binder.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. ] + [[link asio.reference.executor_binder.target_type [*target_type]]] + [The type of the target object. ] ] @@ -63258,7 +64797,7 @@ [[Name][Description]] [ - [[link asio.reference.executor_wrapper.executor_wrapper [*executor_wrapper]]] + [[link asio.reference.executor_binder.executor_binder [*executor_binder]]] [Construct an executor wrapper for the specified object. Copy constructor. @@ -63271,7 +64810,7 @@ Move constructor. - Move construct the wrapped object, but specify a different executor. + Move construct the target object, but specify a different executor. Move construct from a different executor wrapper type. @@ -63279,22 +64818,22 @@ ] [ - [[link asio.reference.executor_wrapper.get_executor [*get_executor]]] + [[link asio.reference.executor_binder.get [*get]]] + [Obtain a reference to the target object. ] + ] + + [ + [[link asio.reference.executor_binder.get_executor [*get_executor]]] [Obtain the associated executor. ] ] [ - [[link asio.reference.executor_wrapper.operator_lp__rp_ [*operator()]]] + [[link asio.reference.executor_binder.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]]] + [[link asio.reference.executor_binder._executor_binder [*~executor_binder]]] [Destructor. ] ] @@ -63302,14 +64841,14 @@ [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] -[section:argument_type executor_wrapper::argument_type] +[section:argument_type executor_binder::argument_type] -[indexterm2 argument_type..executor_wrapper] +[indexterm2 argument_type..executor_binder] The type of the function's argument. @@ -63332,7 +64871,7 @@ [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] @@ -63340,58 +64879,37 @@ [endsect] +[section:executor_binder executor_binder::executor_binder] -[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] +[indexterm2 executor_binder..executor_binder] Construct an executor wrapper for the specified object. template< typename U> - ``[link asio.reference.executor_wrapper.executor_wrapper.overload1 executor_wrapper]``( + ``[link asio.reference.executor_binder.executor_binder.overload1 executor_binder]``( executor_arg_t , const executor_type & e, U && u); - `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload1 more...]]`` + `` [''''»''' [link asio.reference.executor_binder.executor_binder.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...]]`` + ``[link asio.reference.executor_binder.executor_binder.overload2 executor_binder]``( + const executor_binder & other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload2 more...]]`` Construct a copy, but specify a different executor. - ``[link asio.reference.executor_wrapper.executor_wrapper.overload3 executor_wrapper]``( + ``[link asio.reference.executor_binder.executor_binder.overload3 executor_binder]``( executor_arg_t , const executor_type & e, - const executor_wrapper & other); - `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload3 more...]]`` + const executor_binder & other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload3 more...]]`` Construct a copy of a different executor wrapper type. @@ -63400,9 +64918,9 @@ template< typename U, typename ``[link asio.reference.Executor1 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...]]`` + ``[link asio.reference.executor_binder.executor_binder.overload4 executor_binder]``( + const executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload4 more...]]`` Construct a copy of a different executor wrapper type, but specify a different executor. @@ -63411,29 +64929,29 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - ``[link asio.reference.executor_wrapper.executor_wrapper.overload5 executor_wrapper]``( + ``[link asio.reference.executor_binder.executor_binder.overload5 executor_binder]``( executor_arg_t , const executor_type & e, - const executor_wrapper< U, OtherExecutor > & other); - `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload5 more...]]`` + const executor_binder< U, OtherExecutor > & other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.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...]]`` + ``[link asio.reference.executor_binder.executor_binder.overload6 executor_binder]``( + executor_binder && other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload6 more...]]`` -Move construct the wrapped object, but specify a different executor. +Move construct the target object, but specify a different executor. - ``[link asio.reference.executor_wrapper.executor_wrapper.overload7 executor_wrapper]``( + ``[link asio.reference.executor_binder.executor_binder.overload7 executor_binder]``( executor_arg_t , const executor_type & e, - executor_wrapper && other); - `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload7 more...]]`` + executor_binder && other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload7 more...]]`` Move construct from a different executor wrapper type. @@ -63442,9 +64960,9 @@ template< typename U, typename ``[link asio.reference.Executor1 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...]]`` + ``[link asio.reference.executor_binder.executor_binder.overload8 executor_binder]``( + executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload8 more...]]`` Move construct from a different executor wrapper type, but specify a different executor. @@ -63453,14 +64971,14 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - ``[link asio.reference.executor_wrapper.executor_wrapper.overload9 executor_wrapper]``( + ``[link asio.reference.executor_binder.executor_binder.overload9 executor_binder]``( executor_arg_t , const executor_type & e, - executor_wrapper< U, OtherExecutor > && other); - `` [''''»''' [link asio.reference.executor_wrapper.executor_wrapper.overload9 more...]]`` + executor_binder< U, OtherExecutor > && other); + `` [''''»''' [link asio.reference.executor_binder.executor_binder.overload9 more...]]`` -[section:overload1 executor_wrapper::executor_wrapper (1 of 9 overloads)] +[section:overload1 executor_binder::executor_binder (1 of 9 overloads)] Construct an executor wrapper for the specified object. @@ -63468,7 +64986,7 @@ template< typename U> - executor_wrapper( + executor_binder( executor_arg_t , const executor_type & e, U && u); @@ -63481,14 +64999,14 @@ -[section:overload2 executor_wrapper::executor_wrapper (2 of 9 overloads)] +[section:overload2 executor_binder::executor_binder (2 of 9 overloads)] Copy constructor. - executor_wrapper( - const executor_wrapper & other); + executor_binder( + const executor_binder & other); @@ -63496,16 +65014,16 @@ -[section:overload3 executor_wrapper::executor_wrapper (3 of 9 overloads)] +[section:overload3 executor_binder::executor_binder (3 of 9 overloads)] Construct a copy, but specify a different executor. - executor_wrapper( + executor_binder( executor_arg_t , const executor_type & e, - const executor_wrapper & other); + const executor_binder & other); @@ -63513,7 +65031,7 @@ -[section:overload4 executor_wrapper::executor_wrapper (4 of 9 overloads)] +[section:overload4 executor_binder::executor_binder (4 of 9 overloads)] Construct a copy of a different executor wrapper type. @@ -63522,8 +65040,8 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - executor_wrapper( - const executor_wrapper< U, OtherExecutor > & other); + executor_binder( + const executor_binder< U, OtherExecutor > & other); This constructor is only valid if the `Executor` type is constructible from type `OtherExecutor`, and the type `T` is constructible from type `U`. @@ -63533,7 +65051,7 @@ -[section:overload5 executor_wrapper::executor_wrapper (5 of 9 overloads)] +[section:overload5 executor_binder::executor_binder (5 of 9 overloads)] Construct a copy of a different executor wrapper type, but specify a different executor. @@ -63542,10 +65060,10 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - executor_wrapper( + executor_binder( executor_arg_t , const executor_type & e, - const executor_wrapper< U, OtherExecutor > & other); + const executor_binder< U, OtherExecutor > & other); This constructor is only valid if the type `T` is constructible from type `U`. @@ -63555,14 +65073,14 @@ -[section:overload6 executor_wrapper::executor_wrapper (6 of 9 overloads)] +[section:overload6 executor_binder::executor_binder (6 of 9 overloads)] Move constructor. - executor_wrapper( - executor_wrapper && other); + executor_binder( + executor_binder && other); @@ -63570,16 +65088,16 @@ -[section:overload7 executor_wrapper::executor_wrapper (7 of 9 overloads)] +[section:overload7 executor_binder::executor_binder (7 of 9 overloads)] -Move construct the wrapped object, but specify a different executor. +Move construct the target object, but specify a different executor. - executor_wrapper( + executor_binder( executor_arg_t , const executor_type & e, - executor_wrapper && other); + executor_binder && other); @@ -63587,7 +65105,7 @@ -[section:overload8 executor_wrapper::executor_wrapper (8 of 9 overloads)] +[section:overload8 executor_binder::executor_binder (8 of 9 overloads)] Move construct from a different executor wrapper type. @@ -63596,8 +65114,8 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - executor_wrapper( - executor_wrapper< U, OtherExecutor > && other); + executor_binder( + executor_binder< U, OtherExecutor > && other); @@ -63605,7 +65123,7 @@ -[section:overload9 executor_wrapper::executor_wrapper (9 of 9 overloads)] +[section:overload9 executor_binder::executor_binder (9 of 9 overloads)] Move construct from a different executor wrapper type, but specify a different executor. @@ -63614,10 +65132,10 @@ template< typename U, typename ``[link asio.reference.Executor1 OtherExecutor]``> - executor_wrapper( + executor_binder( executor_arg_t , const executor_type & e, - executor_wrapper< U, OtherExecutor > && other); + executor_binder< U, OtherExecutor > && other); @@ -63627,9 +65145,30 @@ [endsect] -[section:first_argument_type executor_wrapper::first_argument_type] +[section:executor_type executor_binder::executor_type] -[indexterm2 first_argument_type..executor_wrapper] +[indexterm2 executor_type..executor_binder] +The type of the associated executor. + + + typedef Executor executor_type; + + + +[heading Requirements] + +['Header: ][^asio/bind_executor.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:first_argument_type executor_binder::first_argument_type] + +[indexterm2 first_argument_type..executor_binder] The type of the function's first argument. @@ -63652,7 +65191,7 @@ [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] @@ -63660,10 +65199,52 @@ [endsect] +[section:get executor_binder::get] -[section:get_executor executor_wrapper::get_executor] +[indexterm2 get..executor_binder] +Obtain a reference to the target object. -[indexterm2 get_executor..executor_wrapper] + + target_type & ``[link asio.reference.executor_binder.get.overload1 get]``(); + `` [''''»''' [link asio.reference.executor_binder.get.overload1 more...]]`` + + const target_type & ``[link asio.reference.executor_binder.get.overload2 get]``() const; + `` [''''»''' [link asio.reference.executor_binder.get.overload2 more...]]`` + + +[section:overload1 executor_binder::get (1 of 2 overloads)] + + +Obtain a reference to the target object. + + + target_type & get(); + + + +[endsect] + + + +[section:overload2 executor_binder::get (2 of 2 overloads)] + + +Obtain a reference to the target object. + + + const target_type & get() const; + + + +[endsect] + + +[endsect] + + +[section:get_executor executor_binder::get_executor] + +[indexterm2 get_executor..executor_binder] Obtain the associated executor. @@ -63674,24 +65255,24 @@ [endsect] -[section:operator_lp__rp_ executor_wrapper::operator()] +[section:operator_lp__rp_ executor_binder::operator()] -[indexterm2 operator()..executor_wrapper] +[indexterm2 operator()..executor_binder] template< typename... Args> - auto ``[link asio.reference.executor_wrapper.operator_lp__rp_.overload1 operator()]``( + auto ``[link asio.reference.executor_binder.operator_lp__rp_.overload1 operator()]``( Args && ...); - `` [''''»''' [link asio.reference.executor_wrapper.operator_lp__rp_.overload1 more...]]`` + `` [''''»''' [link asio.reference.executor_binder.operator_lp__rp_.overload1 more...]]`` template< typename... Args> - auto ``[link asio.reference.executor_wrapper.operator_lp__rp_.overload2 operator()]``( + auto ``[link asio.reference.executor_binder.operator_lp__rp_.overload2 operator()]``( Args && ...) const; - `` [''''»''' [link asio.reference.executor_wrapper.operator_lp__rp_.overload2 more...]]`` + `` [''''»''' [link asio.reference.executor_binder.operator_lp__rp_.overload2 more...]]`` -[section:overload1 executor_wrapper::operator() (1 of 2 overloads)] +[section:overload1 executor_binder::operator() (1 of 2 overloads)] @@ -63706,7 +65287,7 @@ -[section:overload2 executor_wrapper::operator() (2 of 2 overloads)] +[section:overload2 executor_binder::operator() (2 of 2 overloads)] @@ -63723,9 +65304,9 @@ [endsect] -[section:result_type executor_wrapper::result_type] +[section:result_type executor_binder::result_type] -[indexterm2 result_type..executor_wrapper] +[indexterm2 result_type..executor_binder] The return type if a function. @@ -63748,7 +65329,7 @@ [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] @@ -63757,9 +65338,9 @@ -[section:second_argument_type executor_wrapper::second_argument_type] +[section:second_argument_type executor_binder::second_argument_type] -[indexterm2 second_argument_type..executor_wrapper] +[indexterm2 second_argument_type..executor_binder] The type of the function's second argument. @@ -63782,7 +65363,7 @@ [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] @@ -63790,62 +65371,20 @@ [endsect] -[section:unwrap executor_wrapper::unwrap] -[indexterm2 unwrap..executor_wrapper] -Obtain a reference to the wrapped object. +[section:target_type executor_binder::target_type] + +[indexterm2 target_type..executor_binder] +The type of the target 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; + typedef T target_type; [heading Requirements] -['Header: ][^asio/wrap.hpp] +['Header: ][^asio/bind_executor.hpp] ['Convenience header: ][^asio.hpp] @@ -63854,13 +65393,13 @@ -[section:_executor_wrapper executor_wrapper::~executor_wrapper] +[section:_executor_binder executor_binder::~executor_binder] -[indexterm2 ~executor_wrapper..executor_wrapper] +[indexterm2 ~executor_binder..executor_binder] Destructor. - ~executor_wrapper(); + ~executor_binder(); @@ -63870,6 +65409,228 @@ [endsect] +[section:executor_work_guard executor_work_guard] + + +An object of type `executor_work_guard` controls ownership of executor work within a scope. + + + template< + typename ``[link asio.reference.Executor1 Executor]``> + class executor_work_guard + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.executor_work_guard.executor_type [*executor_type]]] + [The underlying executor type. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.executor_work_guard.executor_work_guard [*executor_work_guard]]] + [Constructs a executor_work_guard object for the specified executor. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.executor_work_guard.get_executor [*get_executor]]] + [Obtain the associated executor. ] + ] + + [ + [[link asio.reference.executor_work_guard.owns_work [*owns_work]]] + [Whether the executor_work_guard object owns some outstanding work. ] + ] + + [ + [[link asio.reference.executor_work_guard.reset [*reset]]] + [Indicate that the work is no longer outstanding. ] + ] + + [ + [[link asio.reference.executor_work_guard._executor_work_guard [*~executor_work_guard]]] + [Destructor. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/executor_work_guard.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:executor_type executor_work_guard::executor_type] + +[indexterm2 executor_type..executor_work_guard] +The underlying executor type. + + + typedef Executor executor_type; + + + +[heading Requirements] + +['Header: ][^asio/executor_work_guard.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:executor_work_guard executor_work_guard::executor_work_guard] + +[indexterm2 executor_work_guard..executor_work_guard] +Constructs a `executor_work_guard` object for the specified executor. + + + explicit ``[link asio.reference.executor_work_guard.executor_work_guard.overload1 executor_work_guard]``( + const executor_type & e); + `` [''''»''' [link asio.reference.executor_work_guard.executor_work_guard.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.executor_work_guard.executor_work_guard.overload2 executor_work_guard]``( + const executor_work_guard & other); + `` [''''»''' [link asio.reference.executor_work_guard.executor_work_guard.overload2 more...]]`` + + +Move constructor. + + + ``[link asio.reference.executor_work_guard.executor_work_guard.overload3 executor_work_guard]``( + executor_work_guard && other); + `` [''''»''' [link asio.reference.executor_work_guard.executor_work_guard.overload3 more...]]`` + + +[section:overload1 executor_work_guard::executor_work_guard (1 of 3 overloads)] + + +Constructs a `executor_work_guard` object for the specified executor. + + + executor_work_guard( + const executor_type & e); + + +Stores a copy of `e` and calls `on_work_started()` on it. + + +[endsect] + + + +[section:overload2 executor_work_guard::executor_work_guard (2 of 3 overloads)] + + +Copy constructor. + + + executor_work_guard( + const executor_work_guard & other); + + + +[endsect] + + + +[section:overload3 executor_work_guard::executor_work_guard (3 of 3 overloads)] + + +Move constructor. + + + executor_work_guard( + executor_work_guard && other); + + + +[endsect] + + +[endsect] + + +[section:get_executor executor_work_guard::get_executor] + +[indexterm2 get_executor..executor_work_guard] +Obtain the associated executor. + + + executor_type get_executor() const; + + + +[endsect] + + + +[section:owns_work executor_work_guard::owns_work] + +[indexterm2 owns_work..executor_work_guard] +Whether the [link asio.reference.executor_work_guard `executor_work_guard`] object owns some outstanding work. + + + bool owns_work() const; + + + +[endsect] + + + +[section:reset executor_work_guard::reset] + +[indexterm2 reset..executor_work_guard] +Indicate that the work is no longer outstanding. + + + void reset(); + + + +[endsect] + + + +[section:_executor_work_guard executor_work_guard::~executor_work_guard] + +[indexterm2 ~executor_work_guard..executor_work_guard] +Destructor. + + + ~executor_work_guard(); + + +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:generic__basic_endpoint generic::basic_endpoint] @@ -65047,8 +66808,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -65884,8 +67650,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -66706,8 +68477,13 @@ ] [ + [[link asio.reference.basic_seq_packet_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_seq_packet_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -67593,8 +69369,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -68273,8 +70054,13 @@ ] [ + [[link asio.reference.basic_waitable_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -68329,7 +70115,7 @@ Performing a blocking wait (C++11): // Construct a timer without setting an expiry time. - asio::steady_timer timer(io_service); + asio::steady_timer timer(io_context); // Set an expiry time relative to now. timer.expires_after(std::chrono::seconds(5)); @@ -68354,7 +70140,7 @@ ... // Construct a timer with an absolute expiry time. - asio::steady_timer timer(io_service, + asio::steady_timer timer(io_context, std::chrono::steady_clock::now() + std::chrono::seconds(60)); // Start an asynchronous wait. @@ -68463,13 +70249,13 @@ [endsect] -[section:io_service io_service] +[section:io_context io_context] Provides core I/O functionality. - class io_service : + class io_context : public execution_context @@ -68479,35 +70265,35 @@ [ - [[link asio.reference.io_service__executor_type [*executor_type]]] - [Executor used to submit functions to an io_service. ] + [[link asio.reference.io_context__executor_type [*executor_type]]] + [Executor used to submit functions to an io_context. ] ] [ - [[link asio.reference.io_service__service [*service]]] - [Base class for all io_service services. ] + [[link asio.reference.io_context__service [*service]]] + [Base class for all io_context services. ] ] [ - [[link asio.reference.io_service__strand [*strand]]] + [[link asio.reference.io_context__strand [*strand]]] [Provides serialised handler execution. ] ] [ - [[link asio.reference.io_service__work [*work]]] - [(Deprecated: Use executor_work.) Class to inform the io_service when it has work to do. ] + [[link asio.reference.io_context__work [*work]]] + [(Deprecated: Use executor_work_guard.) Class to inform the io_context when it has work to do. ] ] [ - [[link asio.reference.io_service.fork_event [*fork_event]]] + [[link asio.reference.io_context.fork_event [*fork_event]]] [Fork-related event notifications. ] ] @@ -68519,77 +70305,77 @@ [[Name][Description]] [ - [[link asio.reference.io_service.dispatch [*dispatch]]] - [(Deprecated: Use asio::dispatch().) Request the io_service to invoke the given handler. ] + [[link asio.reference.io_context.dispatch [*dispatch]]] + [(Deprecated: Use asio::dispatch().) Request the io_context to invoke the given handler. ] ] [ - [[link asio.reference.io_service.get_executor [*get_executor]]] - [Obtains the executor associated with the io_service. ] + [[link asio.reference.io_context.get_executor [*get_executor]]] + [Obtains the executor associated with the io_context. ] ] [ - [[link asio.reference.io_service.io_service [*io_service]]] + [[link asio.reference.io_context.io_context [*io_context]]] [Constructor. ] ] [ - [[link asio.reference.io_service.notify_fork [*notify_fork]]] + [[link asio.reference.io_context.notify_fork [*notify_fork]]] [Notify the execution_context of a fork-related event. ] ] [ - [[link asio.reference.io_service.poll [*poll]]] - [Run the io_service object's event processing loop to execute ready handlers. ] + [[link asio.reference.io_context.poll [*poll]]] + [Run the io_context object's event processing loop to execute ready handlers. ] ] [ - [[link asio.reference.io_service.poll_one [*poll_one]]] - [Run the io_service object's event processing loop to execute one ready handler. ] + [[link asio.reference.io_context.poll_one [*poll_one]]] + [Run the io_context object's event processing loop to execute one ready handler. ] ] [ - [[link asio.reference.io_service.post [*post]]] - [(Deprecated: Use asio::post().) Request the io_service to invoke the given handler and return immediately. ] + [[link asio.reference.io_context.post [*post]]] + [(Deprecated: Use asio::post().) Request the io_context to invoke the given handler and return immediately. ] ] [ - [[link asio.reference.io_service.reset [*reset]]] - [(Deprecated: Use restart().) Reset the io_service in preparation for a subsequent run() invocation. ] + [[link asio.reference.io_context.reset [*reset]]] + [(Deprecated: Use restart().) Reset the io_context 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. ] + [[link asio.reference.io_context.restart [*restart]]] + [Restart the io_context in preparation for a subsequent run() invocation. ] ] [ - [[link asio.reference.io_service.run [*run]]] - [Run the io_service object's event processing loop. ] + [[link asio.reference.io_context.run [*run]]] + [Run the io_context object's event processing loop. ] ] [ - [[link asio.reference.io_service.run_one [*run_one]]] - [Run the io_service object's event processing loop to execute at most one handler. ] + [[link asio.reference.io_context.run_one [*run_one]]] + [Run the io_context object's event processing loop to execute at most one handler. ] ] [ - [[link asio.reference.io_service.stop [*stop]]] - [Stop the io_service object's event processing loop. ] + [[link asio.reference.io_context.stop [*stop]]] + [Stop the io_context object's event processing loop. ] ] [ - [[link asio.reference.io_service.stopped [*stopped]]] - [Determine whether the io_service object has been stopped. ] + [[link asio.reference.io_context.stopped [*stopped]]] + [Determine whether the io_context object has been stopped. ] ] [ - [[link asio.reference.io_service.wrap [*wrap]]] - [(Deprecated: Use asio::wrap().) Create a new handler that automatically dispatches the wrapped handler on the io_service. ] + [[link asio.reference.io_context.wrap [*wrap]]] + [(Deprecated: Use asio::bind_executor().) Create a new handler that automatically dispatches the wrapped handler on the io_context. ] ] [ - [[link asio.reference.io_service._io_service [*~io_service]]] + [[link asio.reference.io_context._io_context [*~io_context]]] [Destructor. ] ] @@ -68600,12 +70386,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service.destroy_context [*destroy_context]]] + [[link asio.reference.io_context.destroy_context [*destroy_context]]] [Destroys all services in the context. ] ] [ - [[link asio.reference.io_service.shutdown_context [*shutdown_context]]] + [[link asio.reference.io_context.shutdown_context [*shutdown_context]]] [Shuts down all services in the context. ] ] @@ -68616,22 +70402,22 @@ [[Name][Description]] [ - [[link asio.reference.io_service.add_service [*add_service]]] + [[link asio.reference.io_context.add_service [*add_service]]] [(Deprecated: Use make_service().) Add a service object to the execution_context. ] ] [ - [[link asio.reference.io_service.has_service [*has_service]]] + [[link asio.reference.io_context.has_service [*has_service]]] [Determine if an execution_context contains a specified service type. ] ] [ - [[link asio.reference.io_service.make_service [*make_service]]] + [[link asio.reference.io_context.make_service [*make_service]]] [Creates a service object and adds it to the execution_context. ] ] [ - [[link asio.reference.io_service.use_service [*use_service]]] + [[link asio.reference.io_context.use_service [*use_service]]] [ Obtain the service object corresponding to the given type. ] @@ -68639,7 +70425,7 @@ ] -The [link asio.reference.io_service `io_service`] class provides the core I/O functionality for users of the asynchronous I/O objects, including: +The [link asio.reference.io_context `io_context`] class provides the core I/O functionality for users of the asynchronous I/O objects, including: * `asio::ip::tcp::socket` @@ -68650,14 +70436,14 @@ * [link asio.reference.deadline_timer `deadline_timer`]. -The [link asio.reference.io_service `io_service`] class also includes facilities intended for developers of custom asynchronous services. +The [link asio.reference.io_context `io_context`] class also includes facilities intended for developers of custom asynchronous services. [heading Thread Safety] ['Distinct] ['objects:] Safe. -['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. +['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_context `io_context`] function, or any function on an I/O object that is associated with the [link asio.reference.io_context `io_context`], is being called in another thread. @@ -68665,7 +70451,7 @@ -Synchronous operations on I/O objects implicitly run the [link asio.reference.io_service `io_service`] object for an individual operation. The [link asio.reference.io_service `io_service`] functions `run()`, `run_one()`, `poll()` or `poll_one()` must be called for the [link asio.reference.io_service `io_service`] to perform asynchronous operations on behalf of a C++ program. Notification that an asynchronous operation has completed is delivered by invocation of the associated handler. Handlers are invoked only by a thread that is currently calling any overload of `run()`, `run_one()`, `poll()` or `poll_one()` for the [link asio.reference.io_service `io_service`]. +Synchronous operations on I/O objects implicitly run the [link asio.reference.io_context `io_context`] object for an individual operation. The [link asio.reference.io_context `io_context`] functions `run()`, `run_one()`, `poll()` or `poll_one()` must be called for the [link asio.reference.io_context `io_context`] to perform asynchronous operations on behalf of a C++ program. Notification that an asynchronous operation has completed is delivered by invocation of the associated handler. Handlers are invoked only by a thread that is currently calling any overload of `run()`, `run_one()`, `poll()` or `poll_one()` for the [link asio.reference.io_context `io_context`]. [heading Effect of exceptions thrown from handlers] @@ -68674,19 +70460,19 @@ 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 `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. +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_context `io_context`] object's thread pool without impacting any other threads in the pool. For example: - asio::io_service io_service; + asio::io_context io_context; ... for (;;) { try { - io_service.run(); + io_context.run(); break; // run() exited normally } catch (my_exception& e) @@ -68699,30 +70485,30 @@ -[heading Stopping the io_service from running out of work] +[heading Stopping the io_context from running out of work] -Some applications may need to prevent an [link asio.reference.io_service `io_service`] object's `run()` call from returning when there is no more work to do. For example, the [link asio.reference.io_service `io_service`] may be being run in a background thread that is launched prior to the application's asynchronous operations. The `run()` call may be kept running by creating an object of type [link asio.reference.io_service__work `io_service::work`]: +Some applications may need to prevent an [link asio.reference.io_context `io_context`] object's `run()` call from returning when there is no more work to do. For example, the [link asio.reference.io_context `io_context`] may be being run in a background thread that is launched prior to the application's asynchronous operations. The `run()` call may be kept running by creating an object of type [link asio.reference.io_context__work `io_context::work`]: - asio::io_service io_service; - asio::io_service::work work(io_service); + asio::io_context io_context; + asio::io_context::work work(io_context); ... -To effect a shutdown, the application will then need to call the [link asio.reference.io_service `io_service`] object's `stop()` member function. This will cause the [link asio.reference.io_service `io_service`] `run()` call to return as soon as possible, abandoning unfinished operations and without permitting ready handlers to be dispatched. +To effect a shutdown, the application will then need to call the [link asio.reference.io_context `io_context`] object's `stop()` member function. This will cause the [link asio.reference.io_context `io_context`] `run()` call to return as soon as possible, abandoning unfinished operations and without permitting ready handlers to be dispatched. Alternatively, if the application requires that all operations and handlers be allowed to finish normally, the work object may be explicitly destroyed. - asio::io_service io_service; - auto_ptr<asio::io_service::work> work( - new asio::io_service::work(io_service)); + asio::io_context io_context; + auto_ptr<asio::io_context::work> work( + new asio::io_context::work(io_context)); ... work.reset(); // Allow run() to exit. @@ -68731,17 +70517,17 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] -[section:add_service io_service::add_service] +[section:add_service io_context::add_service] ['Inherited from execution_context.] -[indexterm2 add_service..io_service] +[indexterm2 add_service..io_context] (Deprecated: Use `make_service()`.) Add a service object to the [link asio.reference.execution_context `execution_context`]. @@ -68786,7 +70572,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -68795,12 +70581,12 @@ -[section:destroy_context io_service::destroy_context] +[section:destroy_context io_context::destroy_context] ['Inherited from execution_context.] -[indexterm2 destroy_context..io_service] +[indexterm2 destroy_context..io_context] Destroys all services in the context. @@ -68819,10 +70605,10 @@ -[section:dispatch io_service::dispatch] +[section:dispatch io_context::dispatch] -[indexterm2 dispatch..io_service] -(Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the [link asio.reference.io_service `io_service`] to invoke the given handler. +[indexterm2 dispatch..io_context] +(Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the [link asio.reference.io_context `io_context`] to invoke the given handler. template< @@ -68831,9 +70617,9 @@ CompletionHandler && handler); -This function is used to ask the [link asio.reference.io_service `io_service`] to execute the given handler. +This function is used to ask the [link asio.reference.io_context `io_context`] to execute the given handler. -The [link asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. The handler may be executed inside this function if the guarantee can be met. +The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. The handler may be executed inside this function if the guarantee can be met. [heading Parameters] @@ -68841,7 +70627,7 @@ [variablelist -[[handler][The handler to be called. The [link asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: `` void handler(); `` @@ -68867,20 +70653,20 @@ -[section:fork_event io_service::fork_event] +[section:fork_event io_context::fork_event] ['Inherited from execution_context.] -[indexterm2 fork_event..io_service] +[indexterm2 fork_event..io_context] Fork-related event notifications. enum fork_event -[indexterm2 fork_prepare..io_service] -[indexterm2 fork_parent..io_service] -[indexterm2 fork_child..io_service] +[indexterm2 fork_prepare..io_context] +[indexterm2 fork_parent..io_context] +[indexterm2 fork_child..io_context] [heading Values] [variablelist @@ -68908,10 +70694,10 @@ -[section:get_executor io_service::get_executor] +[section:get_executor io_context::get_executor] -[indexterm2 get_executor..io_service] -Obtains the executor associated with the [link asio.reference.io_service `io_service`]. +[indexterm2 get_executor..io_context] +Obtains the executor associated with the [link asio.reference.io_context `io_context`]. executor_type get_executor(); @@ -68922,12 +70708,12 @@ -[section:has_service io_service::has_service] +[section:has_service io_context::has_service] ['Inherited from execution_context.] -[indexterm2 has_service..io_service] +[indexterm2 has_service..io_context] Determine if an [link asio.reference.execution_context `execution_context`] contains a specified service type. @@ -68958,7 +70744,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -68966,27 +70752,27 @@ [endsect] -[section:io_service io_service::io_service] +[section:io_context io_context::io_context] -[indexterm2 io_service..io_service] +[indexterm2 io_context..io_context] Constructor. - ``[link asio.reference.io_service.io_service.overload1 io_service]``(); - `` [''''»''' [link asio.reference.io_service.io_service.overload1 more...]]`` + ``[link asio.reference.io_context.io_context.overload1 io_context]``(); + `` [''''»''' [link asio.reference.io_context.io_context.overload1 more...]]`` - explicit ``[link asio.reference.io_service.io_service.overload2 io_service]``( + explicit ``[link asio.reference.io_context.io_context.overload2 io_context]``( std::size_t concurrency_hint); - `` [''''»''' [link asio.reference.io_service.io_service.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.io_context.overload2 more...]]`` -[section:overload1 io_service::io_service (1 of 2 overloads)] +[section:overload1 io_context::io_context (1 of 2 overloads)] Constructor. - io_service(); + io_context(); @@ -68994,13 +70780,13 @@ -[section:overload2 io_service::io_service (2 of 2 overloads)] +[section:overload2 io_context::io_context (2 of 2 overloads)] Constructor. - io_service( + io_context( std::size_t concurrency_hint); @@ -69025,12 +70811,12 @@ [endsect] -[section:make_service io_service::make_service] +[section:make_service io_context::make_service] ['Inherited from execution_context.] -[indexterm2 make_service..io_service] +[indexterm2 make_service..io_context] Creates a service object and adds it to the [link asio.reference.execution_context `execution_context`]. @@ -69070,7 +70856,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -69079,12 +70865,12 @@ -[section:notify_fork io_service::notify_fork] +[section:notify_fork io_context::notify_fork] ['Inherited from execution_context.] -[indexterm2 notify_fork..io_service] +[indexterm2 notify_fork..io_context] Notify the [link asio.reference.execution_context `execution_context`] of a fork-related event. @@ -69147,30 +70933,30 @@ [endsect] -[section:poll io_service::poll] +[section:poll io_context::poll] -[indexterm2 poll..io_service] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers. +[indexterm2 poll..io_context] +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute ready handlers. - std::size_t ``[link asio.reference.io_service.poll.overload1 poll]``(); - `` [''''»''' [link asio.reference.io_service.poll.overload1 more...]]`` + std::size_t ``[link asio.reference.io_context.poll.overload1 poll]``(); + `` [''''»''' [link asio.reference.io_context.poll.overload1 more...]]`` - std::size_t ``[link asio.reference.io_service.poll.overload2 poll]``( + std::size_t ``[link asio.reference.io_context.poll.overload2 poll]``( asio::error_code & ec); - `` [''''»''' [link asio.reference.io_service.poll.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.poll.overload2 more...]]`` -[section:overload1 io_service::poll (1 of 2 overloads)] +[section:overload1 io_context::poll (1 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute ready handlers. std::size_t poll(); -The `poll()` function runs handlers that are ready to run, without blocking, until the [link asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers. +The `poll()` function runs handlers that are ready to run, without blocking, until the [link asio.reference.io_context `io_context`] has been stopped or there are no more ready handlers. [heading Return Value] @@ -69194,17 +70980,17 @@ -[section:overload2 io_service::poll (2 of 2 overloads)] +[section:overload2 io_context::poll (2 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute ready handlers. std::size_t poll( asio::error_code & ec); -The `poll()` function runs handlers that are ready to run, without blocking, until the [link asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers. +The `poll()` function runs handlers that are ready to run, without blocking, until the [link asio.reference.io_context `io_context`] has been stopped or there are no more ready handlers. [heading Parameters] @@ -69229,24 +71015,24 @@ [endsect] -[section:poll_one io_service::poll_one] +[section:poll_one io_context::poll_one] -[indexterm2 poll_one..io_service] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler. +[indexterm2 poll_one..io_context] +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute one ready handler. - std::size_t ``[link asio.reference.io_service.poll_one.overload1 poll_one]``(); - `` [''''»''' [link asio.reference.io_service.poll_one.overload1 more...]]`` + std::size_t ``[link asio.reference.io_context.poll_one.overload1 poll_one]``(); + `` [''''»''' [link asio.reference.io_context.poll_one.overload1 more...]]`` - std::size_t ``[link asio.reference.io_service.poll_one.overload2 poll_one]``( + std::size_t ``[link asio.reference.io_context.poll_one.overload2 poll_one]``( asio::error_code & ec); - `` [''''»''' [link asio.reference.io_service.poll_one.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.poll_one.overload2 more...]]`` -[section:overload1 io_service::poll_one (1 of 2 overloads)] +[section:overload1 io_context::poll_one (1 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute one ready handler. std::size_t poll_one(); @@ -69276,10 +71062,10 @@ -[section:overload2 io_service::poll_one (2 of 2 overloads)] +[section:overload2 io_context::poll_one (2 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute one ready handler. std::size_t poll_one( @@ -69312,10 +71098,10 @@ [endsect] -[section:post io_service::post] +[section:post io_context::post] -[indexterm2 post..io_service] -(Deprecated: Use [link asio.reference.post `post`].) Request the [link asio.reference.io_service `io_service`] to invoke the given handler and return immediately. +[indexterm2 post..io_context] +(Deprecated: Use [link asio.reference.post `post`].) Request the [link asio.reference.io_context `io_context`] to invoke the given handler and return immediately. template< @@ -69324,9 +71110,9 @@ CompletionHandler && handler); -This function is used to ask the [link asio.reference.io_service `io_service`] to execute the given handler, but without allowing the [link asio.reference.io_service `io_service`] to call the handler from inside this function. +This function is used to ask the [link asio.reference.io_context `io_context`] to execute the given handler, but without allowing the [link asio.reference.io_context `io_context`] to call the handler from inside this function. -The [link asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. +The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. [heading Parameters] @@ -69334,7 +71120,7 @@ [variablelist -[[handler][The handler to be called. The [link asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be called. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: `` void handler(); `` @@ -69360,16 +71146,16 @@ -[section:reset io_service::reset] +[section:reset io_context::reset] -[indexterm2 reset..io_service] -(Deprecated: Use `restart()`.) Reset the [link asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation. +[indexterm2 reset..io_context] +(Deprecated: Use `restart()`.) Reset the [link asio.reference.io_context `io_context`] 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 `restart()`, 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_context `io_context`] being stopped or running out of work. After a call to `restart()`, the [link asio.reference.io_context `io_context`] 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. @@ -69378,16 +71164,16 @@ -[section:restart io_service::restart] +[section:restart io_context::restart] -[indexterm2 restart..io_service] -Restart the [link asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation. +[indexterm2 restart..io_context] +Restart the [link asio.reference.io_context `io_context`] 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 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_context `io_context`] being stopped or running out of work. After a call to `restart()`, the [link asio.reference.io_context `io_context`] 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. @@ -69395,34 +71181,34 @@ [endsect] -[section:run io_service::run] +[section:run io_context::run] -[indexterm2 run..io_service] -Run the [link asio.reference.io_service `io_service`] object's event processing loop. +[indexterm2 run..io_context] +Run the [link asio.reference.io_context `io_context`] object's event processing loop. - std::size_t ``[link asio.reference.io_service.run.overload1 run]``(); - `` [''''»''' [link asio.reference.io_service.run.overload1 more...]]`` + std::size_t ``[link asio.reference.io_context.run.overload1 run]``(); + `` [''''»''' [link asio.reference.io_context.run.overload1 more...]]`` - std::size_t ``[link asio.reference.io_service.run.overload2 run]``( + std::size_t ``[link asio.reference.io_context.run.overload2 run]``( asio::error_code & ec); - `` [''''»''' [link asio.reference.io_service.run.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.run.overload2 more...]]`` -[section:overload1 io_service::run (1 of 2 overloads)] +[section:overload1 io_context::run (1 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop. +Run the [link asio.reference.io_context `io_context`] object's event processing loop. std::size_t run(); -The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link asio.reference.io_service `io_service`] has been stopped. +The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link asio.reference.io_context `io_context`] has been stopped. -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. +Multiple threads may call the `run()` function to set up a pool of threads from which the [link asio.reference.io_context `io_context`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link asio.reference.io_context `io_context`] 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 `restart()`. +A normal exit from the `run()` function implies that the [link asio.reference.io_context `io_context`] 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] @@ -69442,7 +71228,7 @@ [heading Remarks] -The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link asio.reference.io_service `io_service`] object. +The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link asio.reference.io_context `io_context`] object. The `poll()` function may also be used to dispatch ready handlers, but without blocking. @@ -69451,21 +71237,21 @@ -[section:overload2 io_service::run (2 of 2 overloads)] +[section:overload2 io_context::run (2 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop. +Run the [link asio.reference.io_context `io_context`] object's event processing loop. std::size_t run( asio::error_code & ec); -The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link asio.reference.io_service `io_service`] has been stopped. +The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link asio.reference.io_context `io_context`] has been stopped. -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. +Multiple threads may call the `run()` function to set up a pool of threads from which the [link asio.reference.io_context `io_context`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link asio.reference.io_context `io_context`] 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 `restart()`. +A normal exit from the `run()` function implies that the [link asio.reference.io_context `io_context`] 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] @@ -69485,7 +71271,7 @@ [heading Remarks] -The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link asio.reference.io_service `io_service`] object. +The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link asio.reference.io_context `io_context`] object. The `poll()` function may also be used to dispatch ready handlers, but without blocking. @@ -69495,35 +71281,35 @@ [endsect] -[section:run_one io_service::run_one] +[section:run_one io_context::run_one] -[indexterm2 run_one..io_service] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler. +[indexterm2 run_one..io_context] +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute at most one handler. - std::size_t ``[link asio.reference.io_service.run_one.overload1 run_one]``(); - `` [''''»''' [link asio.reference.io_service.run_one.overload1 more...]]`` + std::size_t ``[link asio.reference.io_context.run_one.overload1 run_one]``(); + `` [''''»''' [link asio.reference.io_context.run_one.overload1 more...]]`` - std::size_t ``[link asio.reference.io_service.run_one.overload2 run_one]``( + std::size_t ``[link asio.reference.io_context.run_one.overload2 run_one]``( asio::error_code & ec); - `` [''''»''' [link asio.reference.io_service.run_one.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.run_one.overload2 more...]]`` -[section:overload1 io_service::run_one (1 of 2 overloads)] +[section:overload1 io_context::run_one (1 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute at most one handler. std::size_t run_one(); -The `run_one()` function blocks until one handler has been dispatched, or until the [link asio.reference.io_service `io_service`] has been stopped. +The `run_one()` function blocks until one handler has been dispatched, or until the [link asio.reference.io_context `io_context`] has been stopped. [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 `restart()`. +The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_context `io_context`] 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] @@ -69542,22 +71328,22 @@ -[section:overload2 io_service::run_one (2 of 2 overloads)] +[section:overload2 io_context::run_one (2 of 2 overloads)] -Run the [link asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler. +Run the [link asio.reference.io_context `io_context`] object's event processing loop to execute at most one handler. std::size_t run_one( asio::error_code & ec); -The `run_one()` function blocks until one handler has been dispatched, or until the [link asio.reference.io_service `io_service`] has been stopped. +The `run_one()` function blocks until one handler has been dispatched, or until the [link asio.reference.io_context `io_context`] has been stopped. [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 `restart()`. +The number of handlers that were executed. A zero return value implies that the [link asio.reference.io_context `io_context`] 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. @@ -69570,12 +71356,12 @@ [endsect] -[section:shutdown_context io_service::shutdown_context] +[section:shutdown_context io_context::shutdown_context] ['Inherited from execution_context.] -[indexterm2 shutdown_context..io_service] +[indexterm2 shutdown_context..io_context] Shuts down all services in the context. @@ -69594,37 +71380,37 @@ -[section:stop io_service::stop] +[section:stop io_context::stop] -[indexterm2 stop..io_service] -Stop the [link asio.reference.io_service `io_service`] object's event processing loop. +[indexterm2 stop..io_context] +Stop the [link asio.reference.io_context `io_context`] object's event processing loop. 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 `restart()` is called. +This function does not block, but instead simply signals the [link asio.reference.io_context `io_context`] 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] -[section:stopped io_service::stopped] +[section:stopped io_context::stopped] -[indexterm2 stopped..io_service] -Determine whether the [link asio.reference.io_service `io_service`] object has been stopped. +[indexterm2 stopped..io_context] +Determine whether the [link asio.reference.io_context `io_context`] object has been stopped. bool stopped() const; -This function is used to determine whether an [link asio.reference.io_service `io_service`] object has been stopped, either through an explicit call to `stop()`, or due to running out of work. When an [link asio.reference.io_service `io_service`] object is stopped, calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately without invoking any handlers. +This function is used to determine whether an [link asio.reference.io_context `io_context`] object has been stopped, either through an explicit call to `stop()`, or due to running out of work. When an [link asio.reference.io_context `io_context`] object is stopped, calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately without invoking any handlers. [heading Return Value] -`true` if the [link asio.reference.io_service `io_service`] object is stopped, otherwise `false`. +`true` if the [link asio.reference.io_context `io_context`] object is stopped, otherwise `false`. @@ -69632,15 +71418,15 @@ [endsect] -[section:use_service io_service::use_service] +[section:use_service io_context::use_service] -[indexterm2 use_service..io_service] +[indexterm2 use_service..io_context] 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...]]`` + friend Service & ``[link asio.reference.io_context.use_service.overload1 use_service]``( + io_context & ioc); + `` [''''»''' [link asio.reference.io_context.use_service.overload1 more...]]`` Obtain the service object corresponding to the given type. @@ -69648,22 +71434,22 @@ template< typename ``[link asio.reference.Service Service]``> - friend Service & ``[link asio.reference.io_service.use_service.overload2 use_service]``( + friend Service & ``[link asio.reference.io_context.use_service.overload2 use_service]``( execution_context & e); - `` [''''»''' [link asio.reference.io_service.use_service.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context.use_service.overload2 more...]]`` -[section:overload1 io_service::use_service (1 of 2 overloads)] +[section:overload1 io_context::use_service (1 of 2 overloads)] template< typename ``[link asio.reference.Service Service]``> friend Service & use_service( - io_service & ios); + io_context & ioc); -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. +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_context `io_context`] will create a new instance of the service. [heading Parameters] @@ -69671,7 +71457,7 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] ] @@ -69683,13 +71469,13 @@ [heading Remarks] -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -69698,7 +71484,7 @@ -[section:overload2 io_service::use_service (2 of 2 overloads)] +[section:overload2 io_context::use_service (2 of 2 overloads)] ['Inherited from execution_context.] @@ -69734,7 +71520,7 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -69745,10 +71531,10 @@ [endsect] -[section:wrap io_service::wrap] +[section:wrap io_context::wrap] -[indexterm2 wrap..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`]. +[indexterm2 wrap..io_context] +(Deprecated: Use [link asio.reference.bind_executor `bind_executor`].) Create a new handler that automatically dispatches the wrapped handler on the [link asio.reference.io_context `io_context`]. template< @@ -69757,7 +71543,7 @@ Handler handler); -This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the [link asio.reference.io_service `io_service`] object's dispatch function. +This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the [link asio.reference.io_context `io_context`] object's dispatch function. [heading Parameters] @@ -69765,7 +71551,7 @@ [variablelist -[[handler][The handler to be wrapped. The [link asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be: +[[handler][The handler to be wrapped. The [link asio.reference.io_context `io_context`] will make a copy of the handler object as required. The function signature of the handler must be: `` void handler(A1 a1, ... An an); `` @@ -69776,14 +71562,14 @@ [heading Return Value] -A function object that, when invoked, passes the wrapped handler to the [link asio.reference.io_service `io_service`] object's dispatch function. Given a function object with the signature: +A function object that, when invoked, passes the wrapped handler to the [link asio.reference.io_context `io_context`] object's dispatch function. Given a function object with the signature: R f(A1 a1, ... An an); If this function object is passed to the wrap function like so: - io_service.wrap(f); + io_context.wrap(f); then the return value is a function object with the signature @@ -69793,7 +71579,7 @@ that, when invoked, executes code equivalent to: - io_service.dispatch(boost::bind(f, a1, ... an)); + io_context.dispatch(boost::bind(f, a1, ... an)); @@ -69805,25 +71591,25 @@ -[section:_io_service io_service::~io_service] +[section:_io_context io_context::~io_context] -[indexterm2 ~io_service..io_service] +[indexterm2 ~io_context..io_context] Destructor. - ~io_service(); + ~io_context(); -On destruction, the [link asio.reference.io_service `io_service`] performs the following sequence of operations: +On destruction, the [link asio.reference.io_context `io_context`] performs the following sequence of operations: -* For each service object `svc` in the [link asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. +* For each service object `svc` in the [link asio.reference.io_context `io_context`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`. -* Uninvoked handler objects that were scheduled for deferred invocation on the [link asio.reference.io_service `io_service`], or any associated strand, are destroyed. +* Uninvoked handler objects that were scheduled for deferred invocation on the [link asio.reference.io_context `io_context`], or any associated strand, are destroyed. -* For each service object `svc` in the [link asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `delete static_cast<io_service::service*>(svc)`. +* For each service object `svc` in the [link asio.reference.io_context `io_context`] set, in reverse order of the beginning of service object lifetime, performs `delete static_cast<io_context::service*>(svc)`. [heading Remarks] @@ -69834,7 +71620,7 @@ * 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 defined above destroys all handlers, causing all `shared_ptr` references to all connection objects to be destroyed. +* To shut down the whole program, the [link asio.reference.io_context `io_context`] function `stop()` is called to terminate any `run()` calls as soon as possible. The [link asio.reference.io_context `io_context`] destructor defined above destroys all handlers, causing all `shared_ptr` references to all connection objects to be destroyed. @@ -69845,10 +71631,10 @@ [endsect] -[section:io_service__executor_type io_service::executor_type] +[section:io_context__executor_type io_context::executor_type] -Executor used to submit functions to an [link asio.reference.io_service `io_service`]. +Executor used to submit functions to an [link asio.reference.io_context `io_context`]. class executor_type @@ -69859,38 +71645,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -69900,12 +71686,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -69913,18 +71699,18 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] -[section:context io_service::executor_type::context] +[section:context io_context::executor_type::context] -[indexterm2 context..io_service::executor_type] +[indexterm2 context..io_context::executor_type] Obtain the underlying execution context. - io_service & context(); + io_context & context(); @@ -69932,10 +71718,10 @@ -[section:defer io_service::executor_type::defer] +[section:defer io_context::executor_type::defer] -[indexterm2 defer..io_service::executor_type] -Request the [link asio.reference.io_service `io_service`] to invoke the given function object. +[indexterm2 defer..io_context::executor_type] +Request the [link asio.reference.io_context `io_context`] to invoke the given function object. template< @@ -69946,9 +71732,9 @@ 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`]. +This function is used to ask the [link asio.reference.io_context `io_context`] 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_context `io_context`]. -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. +If the current thread belongs to the [link asio.reference.io_context `io_context`], `defer()` will delay scheduling the function object until the current thread returns control to the pool. [heading Parameters] @@ -69973,10 +71759,10 @@ -[section:dispatch io_service::executor_type::dispatch] +[section:dispatch io_context::executor_type::dispatch] -[indexterm2 dispatch..io_service::executor_type] -Request the [link asio.reference.io_service `io_service`] to invoke the given function object. +[indexterm2 dispatch..io_context::executor_type] +Request the [link asio.reference.io_context `io_context`] to invoke the given function object. template< @@ -69987,7 +71773,7 @@ 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`]. +This function is used to ask the [link asio.reference.io_context `io_context`] to execute the given function object. If the current thread is running the [link asio.reference.io_context `io_context`], `dispatch()` executes the function before returning. Otherwise, the function will be scheduled to run on the [link asio.reference.io_context `io_context`]. [heading Parameters] @@ -70012,41 +71798,41 @@ -[section:on_work_finished io_service::executor_type::on_work_finished] +[section:on_work_finished io_context::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. +[indexterm2 on_work_finished..io_context::executor_type] +Inform the [link asio.reference.io_context `io_context`] 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. +This function is used to inform the [link asio.reference.io_context `io_context`] that some work has finished. Once the count of unfinished work reaches zero, the [link asio.reference.io_context `io_context`] is stopped and the `run()` and `run_one()` functions may exit. [endsect] -[section:on_work_started io_service::executor_type::on_work_started] +[section:on_work_started io_context::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. +[indexterm2 on_work_started..io_context::executor_type] +Inform the [link asio.reference.io_context `io_context`] 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. +This function is used to inform the [link asio.reference.io_context `io_context`] that some work has begun. This ensures that the io\_context's `run()` and `run_one()` functions do not exit while the work is underway. [endsect] -[section:operator_not__eq_ io_service::executor_type::operator!=] +[section:operator_not__eq_ io_context::executor_type::operator!=] -[indexterm2 operator!=..io_service::executor_type] +[indexterm2 operator!=..io_context::executor_type] Compare two executors for inequality. @@ -70055,11 +71841,11 @@ const executor_type & b); -Two executors are equal if they refer to the same underlying [link asio.reference.io_service `io_service`]. +Two executors are equal if they refer to the same underlying [link asio.reference.io_context `io_context`]. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -70068,9 +71854,9 @@ -[section:operator_eq__eq_ io_service::executor_type::operator==] +[section:operator_eq__eq_ io_context::executor_type::operator==] -[indexterm2 operator==..io_service::executor_type] +[indexterm2 operator==..io_context::executor_type] Compare two executors for equality. @@ -70079,11 +71865,11 @@ const executor_type & b); -Two executors are equal if they refer to the same underlying [link asio.reference.io_service `io_service`]. +Two executors are equal if they refer to the same underlying [link asio.reference.io_context `io_context`]. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] @@ -70092,10 +71878,10 @@ -[section:post io_service::executor_type::post] +[section:post io_context::executor_type::post] -[indexterm2 post..io_service::executor_type] -Request the [link asio.reference.io_service `io_service`] to invoke the given function object. +[indexterm2 post..io_context::executor_type] +Request the [link asio.reference.io_context `io_context`] to invoke the given function object. template< @@ -70106,7 +71892,7 @@ 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`]. +This function is used to ask the [link asio.reference.io_context `io_context`] 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_context `io_context`]. [heading Parameters] @@ -70131,10 +71917,10 @@ -[section:running_in_this_thread io_service::executor_type::running_in_this_thread] +[section:running_in_this_thread io_context::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. +[indexterm2 running_in_this_thread..io_context::executor_type] +Determine whether the [link asio.reference.io_context `io_context`] is running in the current thread. bool running_in_this_thread() const; @@ -70143,7 +71929,7 @@ [heading Return Value] -`true` if the current thread is running the [link asio.reference.io_service `io_service`]. Otherwise returns `false`. +`true` if the current thread is running the [link asio.reference.io_context `io_context`]. Otherwise returns `false`. @@ -70154,10 +71940,10 @@ [endsect] -[section:io_service__service io_service::service] +[section:io_context__service io_context::service] -Base class for all [link asio.reference.io_service `io_service`] services. +Base class for all [link asio.reference.io_context `io_context`] services. class service @@ -70168,8 +71954,13 @@ [[Name][Description]] [ - [[link asio.reference.io_service__service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [[link asio.reference.io_context__service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ + [[link asio.reference.io_context__service.get_io_service [*get_io_service]]] + [Get the io_context object that owns the service. ] ] ] @@ -70179,12 +71970,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__service.service [*service]]] + [[link asio.reference.io_context__service.service [*service]]] [Constructor. ] ] [ - [[link asio.reference.io_service__service._service [*~service]]] + [[link asio.reference.io_context__service._service [*~service]]] [Destructor. ] ] @@ -70192,18 +71983,18 @@ [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] -[section:get_io_service io_service::service::get_io_service] +[section:get_io_context io_context::service::get_io_context] -[indexterm2 get_io_service..io_service::service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +[indexterm2 get_io_context..io_context::service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_context(); @@ -70211,14 +72002,28 @@ -[section:service io_service::service::service] +[section:get_io_service io_context::service::get_io_service] -[indexterm2 service..io_service::service] +[indexterm2 get_io_service..io_context::service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_service(); + + + +[endsect] + + + +[section:service io_context::service::service] + +[indexterm2 service..io_context::service] Constructor. service( - asio::io_service & owner); + asio::io_context & owner); @@ -70227,7 +72032,7 @@ [variablelist -[[owner][The [link asio.reference.io_service `io_service`] object that owns the service. ]] +[[owner][The [link asio.reference.io_context `io_context`] object that owns the service. ]] ] @@ -70238,9 +72043,9 @@ -[section:_service io_service::service::~service] +[section:_service io_context::service::~service] -[indexterm2 ~service..io_service::service] +[indexterm2 ~service..io_context::service] Destructor. @@ -70254,7 +72059,7 @@ [endsect] -[section:io_service__strand io_service::strand] +[section:io_context__strand io_context::strand] Provides serialised handler execution. @@ -70268,61 +72073,66 @@ [[Name][Description]] [ - [[link asio.reference.io_service__strand.context [*context]]] + [[link asio.reference.io_context__strand.context [*context]]] [Obtain the underlying execution context. ] ] [ - [[link asio.reference.io_service__strand.defer [*defer]]] + [[link asio.reference.io_context__strand.defer [*defer]]] [Request the strand to invoke the given function object. ] ] [ - [[link asio.reference.io_service__strand.dispatch [*dispatch]]] + [[link asio.reference.io_context__strand.dispatch [*dispatch]]] [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]]] - [(Deprecated: Use context().) Get the io_service associated with the strand. ] + [[link asio.reference.io_context__strand.get_io_context [*get_io_context]]] + [(Deprecated: Use context().) Get the io_context associated with the strand. ] ] [ - [[link asio.reference.io_service__strand.on_work_finished [*on_work_finished]]] + [[link asio.reference.io_context__strand.get_io_service [*get_io_service]]] + [(Deprecated: Use context().) Get the io_context associated with the strand. ] + ] + + [ + [[link asio.reference.io_context__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]]] + [[link asio.reference.io_context__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]]] + [[link asio.reference.io_context__strand.post [*post]]] [Request the strand to invoke the given function object. (Deprecated: Use asio::post().) Request the strand to invoke the given handler and return immediately. ] ] [ - [[link asio.reference.io_service__strand.running_in_this_thread [*running_in_this_thread]]] + [[link asio.reference.io_context__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]]] + [[link asio.reference.io_context__strand.strand [*strand]]] [Constructor. ] ] [ - [[link asio.reference.io_service__strand.wrap [*wrap]]] - [(Deprecated: Use asio::wrap().) Create a new handler that automatically dispatches the wrapped handler on the strand. ] + [[link asio.reference.io_context__strand.wrap [*wrap]]] + [(Deprecated: Use asio::bind_executor().) Create a new handler that automatically dispatches the wrapped handler on the strand. ] ] [ - [[link asio.reference.io_service__strand._strand [*~strand]]] + [[link asio.reference.io_context__strand._strand [*~strand]]] [Destructor. ] ] @@ -70333,18 +72143,18 @@ [[Name][Description]] [ - [[link asio.reference.io_service__strand.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__strand.operator_not__eq_ [*operator!=]]] [Compare two strands for inequality. ] ] [ - [[link asio.reference.io_service__strand.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__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. +The [link asio.reference.io_context__strand `io_context::strand`] class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently. [heading Order of handler invocation] @@ -70407,18 +72217,18 @@ [heading Requirements] -['Header: ][^asio/io_service_strand.hpp] +['Header: ][^asio/io_context_strand.hpp] ['Convenience header: ][^asio.hpp] -[section:context io_service::strand::context] +[section:context io_context::strand::context] -[indexterm2 context..io_service::strand] +[indexterm2 context..io_context::strand] Obtain the underlying execution context. - asio::io_service & context(); + asio::io_context & context(); @@ -70426,9 +72236,9 @@ -[section:defer io_service::strand::defer] +[section:defer io_context::strand::defer] -[indexterm2 defer..io_service::strand] +[indexterm2 defer..io_context::strand] Request the strand to invoke the given function object. @@ -70440,7 +72250,7 @@ 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`]. +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_context `io_context`]. [heading Parameters] @@ -70464,19 +72274,19 @@ [endsect] -[section:dispatch io_service::strand::dispatch] +[section:dispatch io_context::strand::dispatch] -[indexterm2 dispatch..io_service::strand] +[indexterm2 dispatch..io_context::strand] Request the strand to invoke the given function object. template< typename Function, typename Allocator> - void ``[link asio.reference.io_service__strand.dispatch.overload1 dispatch]``( + void ``[link asio.reference.io_context__strand.dispatch.overload1 dispatch]``( Function && f, const Allocator & a); - `` [''''»''' [link asio.reference.io_service__strand.dispatch.overload1 more...]]`` + `` [''''»''' [link asio.reference.io_context__strand.dispatch.overload1 more...]]`` (Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the strand to invoke the given handler. @@ -70484,12 +72294,12 @@ 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]``( + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.io_context__strand.dispatch.overload2 dispatch]``( CompletionHandler && handler); - `` [''''»''' [link asio.reference.io_service__strand.dispatch.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context__strand.dispatch.overload2 more...]]`` -[section:overload1 io_service::strand::dispatch (1 of 2 overloads)] +[section:overload1 io_context::strand::dispatch (1 of 2 overloads)] Request the strand to invoke the given function object. @@ -70503,7 +72313,7 @@ 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. +This function is used to ask the strand to execute the given function object on its underlying [link asio.reference.io_context `io_context`]. The function object will be executed inside this function if the strand is not otherwise busy and if the underlying io\_context's executor's `dispatch()` function is also able to execute the function before returning. [heading Parameters] @@ -70528,7 +72338,7 @@ -[section:overload2 io_service::strand::dispatch (2 of 2 overloads)] +[section:overload2 io_context::strand::dispatch (2 of 2 overloads)] (Deprecated: Use [link asio.reference.dispatch `dispatch`].) Request the strand to invoke the given handler. @@ -70544,7 +72354,7 @@ The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The handler may be executed inside this function if the guarantee can be met. If this function is called from within a handler that was posted or dispatched through the same strand, then the new handler will be executed immediately. -The strand's guarantee is in addition to the guarantee provided by the underlying [link asio.reference.io_service `io_service`]. The [link asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked. +The strand's guarantee is in addition to the guarantee provided by the underlying [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the io\_context's run member function is currently being invoked. [heading Parameters] @@ -70569,21 +72379,21 @@ [endsect] -[section:get_io_service io_service::strand::get_io_service] +[section:get_io_context io_context::strand::get_io_context] -[indexterm2 get_io_service..io_service::strand] -(Deprecated: Use `context()`.) Get the [link asio.reference.io_service `io_service`] associated with the strand. +[indexterm2 get_io_context..io_context::strand] +(Deprecated: Use `context()`.) Get the [link asio.reference.io_context `io_context`] associated with the strand. - asio::io_service & get_io_service(); + asio::io_context & get_io_context(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the strand uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the strand uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller. @@ -70592,41 +72402,64 @@ -[section:on_work_finished io_service::strand::on_work_finished] +[section:get_io_service io_context::strand::get_io_service] -[indexterm2 on_work_finished..io_service::strand] +[indexterm2 get_io_service..io_context::strand] +(Deprecated: Use `context()`.) Get the [link asio.reference.io_context `io_context`] associated with the strand. + + + asio::io_context & get_io_service(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the strand uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + +[section:on_work_finished io_context::strand::on_work_finished] + +[indexterm2 on_work_finished..io_context::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`]. +The strand delegates this call to its underlying [link asio.reference.io_context `io_context`]. [endsect] -[section:on_work_started io_service::strand::on_work_started] +[section:on_work_started io_context::strand::on_work_started] -[indexterm2 on_work_started..io_service::strand] +[indexterm2 on_work_started..io_context::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`]. +The strand delegates this call to its underlying [link asio.reference.io_context `io_context`]. [endsect] -[section:operator_not__eq_ io_service::strand::operator!=] +[section:operator_not__eq_ io_context::strand::operator!=] -[indexterm2 operator!=..io_service::strand] +[indexterm2 operator!=..io_context::strand] Compare two strands for inequality. @@ -70639,7 +72472,7 @@ [heading Requirements] -['Header: ][^asio/io_service_strand.hpp] +['Header: ][^asio/io_context_strand.hpp] ['Convenience header: ][^asio.hpp] @@ -70648,9 +72481,9 @@ -[section:operator_eq__eq_ io_service::strand::operator==] +[section:operator_eq__eq_ io_context::strand::operator==] -[indexterm2 operator==..io_service::strand] +[indexterm2 operator==..io_context::strand] Compare two strands for equality. @@ -70663,7 +72496,7 @@ [heading Requirements] -['Header: ][^asio/io_service_strand.hpp] +['Header: ][^asio/io_context_strand.hpp] ['Convenience header: ][^asio.hpp] @@ -70671,19 +72504,19 @@ [endsect] -[section:post io_service::strand::post] +[section:post io_context::strand::post] -[indexterm2 post..io_service::strand] +[indexterm2 post..io_context::strand] Request the strand to invoke the given function object. template< typename Function, typename Allocator> - void ``[link asio.reference.io_service__strand.post.overload1 post]``( + void ``[link asio.reference.io_context__strand.post.overload1 post]``( Function && f, const Allocator & a); - `` [''''»''' [link asio.reference.io_service__strand.post.overload1 more...]]`` + `` [''''»''' [link asio.reference.io_context__strand.post.overload1 more...]]`` (Deprecated: Use [link asio.reference.post `post`].) Request the strand to invoke the given handler and return immediately. @@ -70691,12 +72524,12 @@ 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]``( + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.io_context__strand.post.overload2 post]``( CompletionHandler && handler); - `` [''''»''' [link asio.reference.io_service__strand.post.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context__strand.post.overload2 more...]]`` -[section:overload1 io_service::strand::post (1 of 2 overloads)] +[section:overload1 io_context::strand::post (1 of 2 overloads)] Request the strand to invoke the given function object. @@ -70710,7 +72543,7 @@ 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`]. +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_context `io_context`]. [heading Parameters] @@ -70735,7 +72568,7 @@ -[section:overload2 io_service::strand::post (2 of 2 overloads)] +[section:overload2 io_context::strand::post (2 of 2 overloads)] (Deprecated: Use [link asio.reference.post `post`].) Request the strand to invoke the given handler and return immediately. @@ -70749,7 +72582,7 @@ This function is used to ask the strand to execute the given handler, but without allowing the strand to call the handler from inside this function. -The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The strand's guarantee is in addition to the guarantee provided by the underlying [link asio.reference.io_service `io_service`]. The [link asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked. +The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The strand's guarantee is in addition to the guarantee provided by the underlying [link asio.reference.io_context `io_context`]. The [link asio.reference.io_context `io_context`] guarantees that the handler will only be called in a thread in which the io\_context's run member function is currently being invoked. [heading Parameters] @@ -70774,9 +72607,9 @@ [endsect] -[section:running_in_this_thread io_service::strand::running_in_this_thread] +[section:running_in_this_thread io_context::strand::running_in_this_thread] -[indexterm2 running_in_this_thread..io_service::strand] +[indexterm2 running_in_this_thread..io_context::strand] Determine whether the strand is running in the current thread. @@ -70795,14 +72628,14 @@ -[section:strand io_service::strand::strand] +[section:strand io_context::strand::strand] -[indexterm2 strand..io_service::strand] +[indexterm2 strand..io_context::strand] Constructor. strand( - asio::io_service & io_service); + asio::io_context & io_context); Constructs the strand. @@ -70813,7 +72646,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers that are ready to be run. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the strand will use to dispatch handlers that are ready to be run. ]] ] @@ -70824,10 +72657,10 @@ -[section:wrap io_service::strand::wrap] +[section:wrap io_context::strand::wrap] -[indexterm2 wrap..io_service::strand] -(Deprecated: Use [link asio.reference.wrap `wrap`].) Create a new handler that automatically dispatches the wrapped handler on the strand. +[indexterm2 wrap..io_context::strand] +(Deprecated: Use [link asio.reference.bind_executor `bind_executor`].) Create a new handler that automatically dispatches the wrapped handler on the strand. template< @@ -70884,9 +72717,9 @@ -[section:_strand io_service::strand::~strand] +[section:_strand io_context::strand::~strand] -[indexterm2 ~strand..io_service::strand] +[indexterm2 ~strand..io_context::strand] Destructor. @@ -70904,10 +72737,10 @@ [endsect] -[section:io_service__work io_service::work] +[section:io_context__work io_context::work] -(Deprecated: Use [link asio.reference.executor_work `executor_work`].) Class to inform the [link asio.reference.io_service `io_service`] when it has work to do. +(Deprecated: Use [link asio.reference.executor_work_guard `executor_work_guard`].) Class to inform the [link asio.reference.io_context `io_context`] when it has work to do. class work @@ -70918,95 +72751,114 @@ [[Name][Description]] [ - [[link asio.reference.io_service__work.get_io_service [*get_io_service]]] - [Get the io_service associated with the work. ] + [[link asio.reference.io_context__work.get_io_context [*get_io_context]]] + [Get the io_context associated with the work. ] ] [ - [[link asio.reference.io_service__work.work [*work]]] - [Constructor notifies the io_service that work is starting. + [[link asio.reference.io_context__work.get_io_service [*get_io_service]]] + [(Deprecated: Use get_io_context().) Get the io_context associated with the work. ] + ] + + [ + [[link asio.reference.io_context__work.work [*work]]] + [Constructor notifies the io_context that work is starting. - Copy constructor notifies the io_service that work is starting. ] + Copy constructor notifies the io_context that work is starting. ] ] [ - [[link asio.reference.io_service__work._work [*~work]]] - [Destructor notifies the io_service that the work is complete. ] + [[link asio.reference.io_context__work._work [*~work]]] + [Destructor notifies the io_context that the work is complete. ] ] ] -The work class is used to inform the [link asio.reference.io_service `io_service`] when work starts and finishes. This ensures that the [link asio.reference.io_service `io_service`] object's `run()` function will not exit while work is underway, and that it does exit when there is no unfinished work remaining. +The work class is used to inform the [link asio.reference.io_context `io_context`] when work starts and finishes. This ensures that the [link asio.reference.io_context `io_context`] object's `run()` function will not exit while work is underway, and that it does exit when there is no unfinished work remaining. The work class is copy-constructible so that it may be used as a data member in a handler class. It is not assignable. [heading Requirements] -['Header: ][^asio/io_service.hpp] +['Header: ][^asio/io_context.hpp] ['Convenience header: ][^asio.hpp] -[section:get_io_service io_service::work::get_io_service] +[section:get_io_context io_context::work::get_io_context] -[indexterm2 get_io_service..io_service::work] -Get the [link asio.reference.io_service `io_service`] associated with the work. +[indexterm2 get_io_context..io_context::work] +Get the [link asio.reference.io_context `io_context`] associated with the work. - asio::io_service & get_io_service(); + asio::io_context & get_io_context(); [endsect] -[section:work io_service::work::work] -[indexterm2 work..io_service::work] -Constructor notifies the [link asio.reference.io_service `io_service`] that work is starting. +[section:get_io_service io_context::work::get_io_service] + +[indexterm2 get_io_service..io_context::work] +(Deprecated: Use `get_io_context()`.) Get the [link asio.reference.io_context `io_context`] associated with the work. - explicit ``[link asio.reference.io_service__work.work.overload1 work]``( - asio::io_service & io_service); - `` [''''»''' [link asio.reference.io_service__work.work.overload1 more...]]`` + asio::io_context & get_io_service(); -Copy constructor notifies the [link asio.reference.io_service `io_service`] that work is starting. + +[endsect] - ``[link asio.reference.io_service__work.work.overload2 work]``( +[section:work io_context::work::work] + +[indexterm2 work..io_context::work] +Constructor notifies the [link asio.reference.io_context `io_context`] that work is starting. + + + explicit ``[link asio.reference.io_context__work.work.overload1 work]``( + asio::io_context & io_context); + `` [''''»''' [link asio.reference.io_context__work.work.overload1 more...]]`` + + +Copy constructor notifies the [link asio.reference.io_context `io_context`] that work is starting. + + + ``[link asio.reference.io_context__work.work.overload2 work]``( const work & other); - `` [''''»''' [link asio.reference.io_service__work.work.overload2 more...]]`` + `` [''''»''' [link asio.reference.io_context__work.work.overload2 more...]]`` -[section:overload1 io_service::work::work (1 of 2 overloads)] +[section:overload1 io_context::work::work (1 of 2 overloads)] -Constructor notifies the [link asio.reference.io_service `io_service`] that work is starting. +Constructor notifies the [link asio.reference.io_context `io_context`] that work is starting. work( - asio::io_service & io_service); + asio::io_context & io_context); -The constructor is used to inform the [link asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway. +The constructor is used to inform the [link asio.reference.io_context `io_context`] that some work has begun. This ensures that the [link asio.reference.io_context `io_context`] object's `run()` function will not exit while the work is underway. [endsect] -[section:overload2 io_service::work::work (2 of 2 overloads)] +[section:overload2 io_context::work::work (2 of 2 overloads)] -Copy constructor notifies the [link asio.reference.io_service `io_service`] that work is starting. +Copy constructor notifies the [link asio.reference.io_context `io_context`] that work is starting. work( const work & other); -The constructor is used to inform the [link asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway. +The constructor is used to inform the [link asio.reference.io_context `io_context`] that some work has begun. This ensures that the [link asio.reference.io_context `io_context`] object's `run()` function will not exit while the work is underway. [endsect] @@ -71015,16 +72867,16 @@ [endsect] -[section:_work io_service::work::~work] +[section:_work io_context::work::~work] -[indexterm2 ~work..io_service::work] -Destructor notifies the [link asio.reference.io_service `io_service`] that the work is complete. +[indexterm2 ~work..io_context::work] +Destructor notifies the [link asio.reference.io_context `io_context`] that the work is complete. ~work(); -The destructor 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`] object's `run()` function is permitted to exit. +The destructor is used to inform the [link asio.reference.io_context `io_context`] that some work has finished. Once the count of unfinished work reaches zero, the [link asio.reference.io_context `io_context`] object's `run()` function is permitted to exit. [endsect] @@ -71098,7 +72950,9 @@ [ [[link asio.reference.ip__address.to_string [*to_string]]] - [Get the address as a string in dotted decimal format. ] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] ] [ @@ -71770,12 +73624,16 @@ [section:to_string ip::address::to_string] [indexterm2 to_string..ip::address] -Get the address as a string in dotted decimal format. +Get the address as a string. std::string ``[link asio.reference.ip__address.to_string.overload1 to_string]``() const; `` [''''»''' [link asio.reference.ip__address.to_string.overload1 more...]]`` + +(Deprecated: Use other overload.) Get the address as a string. + + std::string ``[link asio.reference.ip__address.to_string.overload2 to_string]``( asio::error_code & ec) const; `` [''''»''' [link asio.reference.ip__address.to_string.overload2 more...]]`` @@ -71784,7 +73642,7 @@ [section:overload1 ip::address::to_string (1 of 2 overloads)] -Get the address as a string in dotted decimal format. +Get the address as a string. std::string to_string() const; @@ -71798,7 +73656,7 @@ [section:overload2 ip::address::to_string (2 of 2 overloads)] -Get the address as a string in dotted decimal format. +(Deprecated: Use other overload.) Get the address as a string. std::string to_string( @@ -71842,2730 +73700,6 @@ [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_iterator_v4 ip::address_iterator_v4] - - -An input iterator that can be used for traversing IPv4 addresses. - - - class address_iterator_v4 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_iterator_v4.difference_type [*difference_type]]] - [Distance between two iterators. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.iterator_category [*iterator_category]]] - [Denotes that the iterator satisfies the input iterator requirements. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.pointer [*pointer]]] - [The type of a pointer to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.reference [*reference]]] - [The type of a reference to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.value_type [*value_type]]] - [The type of the elements pointed to by the iterator. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v4.address_iterator_v4 [*address_iterator_v4]]] - [Construct an iterator that points to the specified address. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator__star_ [*operator *]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_plus__plus_ [*operator++]]] - [Pre-increment operator. - - Post-increment operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_minus__minus_ [*operator--]]] - [Pre-decrement operator. - - Post-decrement operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_arrow_ [*operator->]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - -] - -In addition to satisfying the input iterator requirements, this iterator also supports decrement. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - -[section:address_iterator_v4 ip::address_iterator_v4::address_iterator_v4] - -[indexterm2 address_iterator_v4..ip::address_iterator_v4] -Construct an iterator that points to the specified address. - - - ``[link asio.reference.ip__address_iterator_v4.address_iterator_v4.overload1 address_iterator_v4]``( - const address_v4 & addr); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.address_iterator_v4.overload1 more...]]`` - - -Copy constructor. - - - ``[link asio.reference.ip__address_iterator_v4.address_iterator_v4.overload2 address_iterator_v4]``( - const address_iterator_v4 & other); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.address_iterator_v4.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v4::address_iterator_v4 (1 of 2 overloads)] - - -Construct an iterator that points to the specified address. - - - address_iterator_v4( - const address_v4 & addr); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v4::address_iterator_v4 (2 of 2 overloads)] - - -Copy constructor. - - - address_iterator_v4( - const address_iterator_v4 & other); - - - -[endsect] - - -[endsect] - - -[section:difference_type ip::address_iterator_v4::difference_type] - -[indexterm2 difference_type..ip::address_iterator_v4] -Distance between two iterators. - - - typedef std::ptrdiff_t difference_type; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:iterator_category ip::address_iterator_v4::iterator_category] - -[indexterm2 iterator_category..ip::address_iterator_v4] -Denotes that the iterator satisfies the input iterator requirements. - - - typedef std::input_iterator_tag iterator_category; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:operator__star_ ip::address_iterator_v4::operator *] - -[indexterm2 operator *..ip::address_iterator_v4] -Dereference the iterator. - - - const address_v4 & operator *() const; - - - -[endsect] - - - -[section:operator_not__eq_ ip::address_iterator_v4::operator!=] - -[indexterm2 operator!=..ip::address_iterator_v4] -Compare two addresses for inequality. - - - friend bool operator!=( - const address_iterator_v4 & a, - const address_iterator_v4 & b); - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - -[section:operator_plus__plus_ ip::address_iterator_v4::operator++] - -[indexterm2 operator++..ip::address_iterator_v4] -Pre-increment operator. - - - address_iterator_v4 & ``[link asio.reference.ip__address_iterator_v4.operator_plus__plus_.overload1 operator++]``(); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.operator_plus__plus_.overload1 more...]]`` - - -Post-increment operator. - - - address_iterator_v4 ``[link asio.reference.ip__address_iterator_v4.operator_plus__plus_.overload2 operator++]``( - int ); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.operator_plus__plus_.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v4::operator++ (1 of 2 overloads)] - - -Pre-increment operator. - - - address_iterator_v4 & operator++(); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v4::operator++ (2 of 2 overloads)] - - -Post-increment operator. - - - address_iterator_v4 operator++( - int ); - - - -[endsect] - - -[endsect] - -[section:operator_minus__minus_ ip::address_iterator_v4::operator--] - -[indexterm2 operator--..ip::address_iterator_v4] -Pre-decrement operator. - - - address_iterator_v4 & ``[link asio.reference.ip__address_iterator_v4.operator_minus__minus_.overload1 operator--]``(); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.operator_minus__minus_.overload1 more...]]`` - - -Post-decrement operator. - - - address_iterator_v4 ``[link asio.reference.ip__address_iterator_v4.operator_minus__minus_.overload2 operator--]``( - int ); - `` [''''»''' [link asio.reference.ip__address_iterator_v4.operator_minus__minus_.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v4::operator-- (1 of 2 overloads)] - - -Pre-decrement operator. - - - address_iterator_v4 & operator--(); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v4::operator-- (2 of 2 overloads)] - - -Post-decrement operator. - - - address_iterator_v4 operator--( - int ); - - - -[endsect] - - -[endsect] - - -[section:operator_arrow_ ip::address_iterator_v4::operator->] - -[indexterm2 operator->..ip::address_iterator_v4] -Dereference the iterator. - - - const address_v4 * operator->() const; - - - -[endsect] - - - -[section:operator_eq_ ip::address_iterator_v4::operator=] - -[indexterm2 operator=..ip::address_iterator_v4] -Assignment operator. - - - address_iterator_v4 & operator=( - const address_iterator_v4 & other); - - - -[endsect] - - - -[section:operator_eq__eq_ ip::address_iterator_v4::operator==] - -[indexterm2 operator==..ip::address_iterator_v4] -Compare two addresses for equality. - - - friend bool operator==( - const address_iterator_v4 & a, - const address_iterator_v4 & b); - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:pointer ip::address_iterator_v4::pointer] - -[indexterm2 pointer..ip::address_iterator_v4] -The type of a pointer to an element pointed to by the iterator. - - - typedef const address_v4 * pointer; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:reference ip::address_iterator_v4::reference] - -[indexterm2 reference..ip::address_iterator_v4] -The type of a reference to an element pointed to by the iterator. - - - typedef const address_v4 & reference; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] - [The type used to represent an address as an array of bytes. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] - [Default constructor. - - Construct an address from raw bytes. - - Construct an address from an unsigned long in host byte order. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_v4.any [*any]]] - [Obtain an address object that represents any address. ] - ] - - [ - [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] - [Obtain an address object that represents the broadcast address. - - Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] - ] - - [ - [[link asio.reference.ip__address_v4.from_string [*from_string]]] - [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] - [Determine whether the address is a class A address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] - [Determine whether the address is a class B address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] - [Determine whether the address is a class C address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] - [Determine whether the address is a loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] - [Determine whether the address is a multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] - [Determine whether the address is unspecified. ] - ] - - [ - [[link asio.reference.ip__address_v4.loopback [*loopback]]] - [Obtain an address object that represents the loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v4.netmask [*netmask]]] - [Obtain the netmask that corresponds to the address, based on its address class. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] - [Assign from another address. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] - [Get the address in bytes, in network byte order. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_string [*to_string]]] - [Get the address as a string in dotted decimal format. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] - [Get the address as an unsigned long in host byte order. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] - [Compare addresses for ordering. ] - ] - -] - -[heading Related Functions] -[table - [[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. - - Create an IPv4 address from a IPv4-mapped IPv6 address. ] - ] - - [ - [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] - [Create an IPv4 network from an address and prefix length. - - Create an IPv4 network from an address and netmask. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] - [Output an address as a string. - - Output a network as a string. ] - ] - -] - -The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:value_type ip::address_iterator_v4::value_type] - -[indexterm2 value_type..ip::address_iterator_v4] -The type of the elements pointed to by the iterator. - - - typedef address_v4 value_type; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] - [The type used to represent an address as an array of bytes. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] - [Default constructor. - - Construct an address from raw bytes. - - Construct an address from an unsigned long in host byte order. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_v4.any [*any]]] - [Obtain an address object that represents any address. ] - ] - - [ - [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] - [Obtain an address object that represents the broadcast address. - - Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] - ] - - [ - [[link asio.reference.ip__address_v4.from_string [*from_string]]] - [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] - [Determine whether the address is a class A address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] - [Determine whether the address is a class B address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] - [Determine whether the address is a class C address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] - [Determine whether the address is a loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] - [Determine whether the address is a multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] - [Determine whether the address is unspecified. ] - ] - - [ - [[link asio.reference.ip__address_v4.loopback [*loopback]]] - [Obtain an address object that represents the loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v4.netmask [*netmask]]] - [Obtain the netmask that corresponds to the address, based on its address class. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] - [Assign from another address. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] - [Get the address in bytes, in network byte order. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_string [*to_string]]] - [Get the address as a string in dotted decimal format. ] - ] - - [ - [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] - [Get the address as an unsigned long in host byte order. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] - [Compare addresses for ordering. ] - ] - -] - -[heading Related Functions] -[table - [[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. - - Create an IPv4 address from a IPv4-mapped IPv6 address. ] - ] - - [ - [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] - [Create an IPv4 network from an address and prefix length. - - Create an IPv4 network from an address and netmask. ] - ] - - [ - [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] - [Output an address as a string. - - Output a network as a string. ] - ] - -] - -The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[endsect] - -[section:ip__address_iterator_v6 ip::address_iterator_v6] - - -An input iterator that can be used for traversing IPv6 addresses. - - - class address_iterator_v6 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_iterator_v6.difference_type [*difference_type]]] - [Distance between two iterators. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.iterator_category [*iterator_category]]] - [Denotes that the iterator satisfies the input iterator requirements. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.pointer [*pointer]]] - [The type of a pointer to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.reference [*reference]]] - [The type of a reference to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.value_type [*value_type]]] - [The type of the elements pointed to by the iterator. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v6.address_iterator_v6 [*address_iterator_v6]]] - [Construct an iterator that points to the specified address. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator__star_ [*operator *]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_plus__plus_ [*operator++]]] - [Pre-increment operator. - - Post-increment operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_minus__minus_ [*operator--]]] - [Pre-decrement operator. - - Post-decrement operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_arrow_ [*operator->]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - -] - -In addition to satisfying the input iterator requirements, this iterator also supports decrement. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - -[section:address_iterator_v6 ip::address_iterator_v6::address_iterator_v6] - -[indexterm2 address_iterator_v6..ip::address_iterator_v6] -Construct an iterator that points to the specified address. - - - ``[link asio.reference.ip__address_iterator_v6.address_iterator_v6.overload1 address_iterator_v6]``( - const address_v6 & addr); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.address_iterator_v6.overload1 more...]]`` - - -Copy constructor. - - - ``[link asio.reference.ip__address_iterator_v6.address_iterator_v6.overload2 address_iterator_v6]``( - const address_iterator_v6 & other); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.address_iterator_v6.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v6::address_iterator_v6 (1 of 2 overloads)] - - -Construct an iterator that points to the specified address. - - - address_iterator_v6( - const address_v6 & addr); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v6::address_iterator_v6 (2 of 2 overloads)] - - -Copy constructor. - - - address_iterator_v6( - const address_iterator_v6 & other); - - - -[endsect] - - -[endsect] - - -[section:difference_type ip::address_iterator_v6::difference_type] - -[indexterm2 difference_type..ip::address_iterator_v6] -Distance between two iterators. - - - typedef std::ptrdiff_t difference_type; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:iterator_category ip::address_iterator_v6::iterator_category] - -[indexterm2 iterator_category..ip::address_iterator_v6] -Denotes that the iterator satisfies the input iterator requirements. - - - typedef std::input_iterator_tag iterator_category; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:operator__star_ ip::address_iterator_v6::operator *] - -[indexterm2 operator *..ip::address_iterator_v6] -Dereference the iterator. - - - const address_v6 & operator *() const; - - - -[endsect] - - - -[section:operator_not__eq_ ip::address_iterator_v6::operator!=] - -[indexterm2 operator!=..ip::address_iterator_v6] -Compare two addresses for inequality. - - - friend bool operator!=( - const address_iterator_v6 & a, - const address_iterator_v6 & b); - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - -[section:operator_plus__plus_ ip::address_iterator_v6::operator++] - -[indexterm2 operator++..ip::address_iterator_v6] -Pre-increment operator. - - - address_iterator_v6 & ``[link asio.reference.ip__address_iterator_v6.operator_plus__plus_.overload1 operator++]``(); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.operator_plus__plus_.overload1 more...]]`` - - -Post-increment operator. - - - address_iterator_v6 ``[link asio.reference.ip__address_iterator_v6.operator_plus__plus_.overload2 operator++]``( - int ); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.operator_plus__plus_.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v6::operator++ (1 of 2 overloads)] - - -Pre-increment operator. - - - address_iterator_v6 & operator++(); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v6::operator++ (2 of 2 overloads)] - - -Post-increment operator. - - - address_iterator_v6 operator++( - int ); - - - -[endsect] - - -[endsect] - -[section:operator_minus__minus_ ip::address_iterator_v6::operator--] - -[indexterm2 operator--..ip::address_iterator_v6] -Pre-decrement operator. - - - address_iterator_v6 & ``[link asio.reference.ip__address_iterator_v6.operator_minus__minus_.overload1 operator--]``(); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.operator_minus__minus_.overload1 more...]]`` - - -Post-decrement operator. - - - address_iterator_v6 ``[link asio.reference.ip__address_iterator_v6.operator_minus__minus_.overload2 operator--]``( - int ); - `` [''''»''' [link asio.reference.ip__address_iterator_v6.operator_minus__minus_.overload2 more...]]`` - - -[section:overload1 ip::address_iterator_v6::operator-- (1 of 2 overloads)] - - -Pre-decrement operator. - - - address_iterator_v6 & operator--(); - - - -[endsect] - - - -[section:overload2 ip::address_iterator_v6::operator-- (2 of 2 overloads)] - - -Post-decrement operator. - - - address_iterator_v6 operator--( - int ); - - - -[endsect] - - -[endsect] - - -[section:operator_arrow_ ip::address_iterator_v6::operator->] - -[indexterm2 operator->..ip::address_iterator_v6] -Dereference the iterator. - - - const address_v6 * operator->() const; - - - -[endsect] - - - -[section:operator_eq_ ip::address_iterator_v6::operator=] - -[indexterm2 operator=..ip::address_iterator_v6] -Assignment operator. - - - address_iterator_v6 & operator=( - const address_iterator_v6 & other); - - - -[endsect] - - - -[section:operator_eq__eq_ ip::address_iterator_v6::operator==] - -[indexterm2 operator==..ip::address_iterator_v6] -Compare two addresses for equality. - - - friend bool operator==( - const address_iterator_v6 & a, - const address_iterator_v6 & b); - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:pointer ip::address_iterator_v6::pointer] - -[indexterm2 pointer..ip::address_iterator_v6] -The type of a pointer to an element pointed to by the iterator. - - - typedef const address_v6 * pointer; - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:reference ip::address_iterator_v6::reference] - -[indexterm2 reference..ip::address_iterator_v6] -The type of a reference to an element pointed to by the iterator. - - - typedef const address_v6 & reference; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] - [The type used to represent an address as an array of bytes. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] - [Default constructor. - - Construct an address from raw bytes and scope ID. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_v6.any [*any]]] - [Obtain an address object that represents any address. ] - ] - - [ - [[link asio.reference.ip__address_v6.from_string [*from_string]]] - [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] - [Determine whether the address is link local. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] - [Determine whether the address is a loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] - [Determine whether the address is a multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] - [Determine whether the address is a global multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] - [Determine whether the address is a link-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] - [Determine whether the address is a node-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] - [Determine whether the address is a org-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] - [Determine whether the address is a site-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] - [Determine whether the address is site local. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] - [Determine whether the address is unspecified. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] - [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] - [Determine whether the address is a mapped IPv4 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.loopback [*loopback]]] - [Obtain an address object that represents the loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] - [Assign from another address. ] - ] - - [ - [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] - [The scope ID of the address. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] - [Get the address in bytes, in network byte order. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_string [*to_string]]] - [Get the address as a string. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] - [(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]]] - [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] - [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] - [Compare addresses for ordering. ] - ] - -] - -[heading Related Functions] -[table - [[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. - - Create an IPv4-mapped IPv6 address from an IPv4 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] - [Create an IPv6 network from an address and prefix length. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] - [Output an address as a string. - - Output a network as a string. ] - ] - -] - -The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:value_type ip::address_iterator_v6::value_type] - -[indexterm2 value_type..ip::address_iterator_v6] -The type of the elements pointed to by the iterator. - - - typedef address_v6 value_type; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] - [The type used to represent an address as an array of bytes. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] - [Default constructor. - - Construct an address from raw bytes and scope ID. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_v6.any [*any]]] - [Obtain an address object that represents any address. ] - ] - - [ - [[link asio.reference.ip__address_v6.from_string [*from_string]]] - [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] - [Determine whether the address is link local. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] - [Determine whether the address is a loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] - [Determine whether the address is a multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] - [Determine whether the address is a global multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] - [Determine whether the address is a link-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] - [Determine whether the address is a node-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] - [Determine whether the address is a org-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] - [Determine whether the address is a site-local multicast address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] - [Determine whether the address is site local. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] - [Determine whether the address is unspecified. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] - [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] - ] - - [ - [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] - [Determine whether the address is a mapped IPv4 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.loopback [*loopback]]] - [Obtain an address object that represents the loopback address. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] - [Assign from another address. ] - ] - - [ - [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] - [The scope ID of the address. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] - [Get the address in bytes, in network byte order. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_string [*to_string]]] - [Get the address as a string. ] - ] - - [ - [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] - [(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]]] - [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] - [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] - [Compare addresses for ordering. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] - [Compare addresses for ordering. ] - ] - -] - -[heading Related Functions] -[table - [[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. - - Create an IPv4-mapped IPv6 address from an IPv4 address. ] - ] - - [ - [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] - [Create an IPv6 network from an address and prefix length. ] - ] - - [ - [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] - [Output an address as a string. - - Output a network as a string. ] - ] - -] - -The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_iterator_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[endsect] - -[section:ip__address_range_v4 ip::address_range_v4] - - -Represents a range of IPv4 addresses. - - - class address_range_v4 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_range_v4.iterator [*iterator]]] - [The type of an iterator that points into the range. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_range_v4.address_range_v4 [*address_range_v4]]] - [Construct an empty range. - - Construct an range that represents the given range of addresses. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.begin [*begin]]] - [Obtain an iterator that points to the start of the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.empty [*empty]]] - [Determine whether the range is empty. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.end [*end]]] - [Obtain an iterator that points to the end of the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.find [*find]]] - [Find an address in the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - - [ - [[link asio.reference.ip__address_range_v4.size [*size]]] - [Return the size of the range. ] - ] - -] - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - -[heading Requirements] - -['Header: ][^asio/ip/address_range_v4.hpp] - -['Convenience header: ][^asio.hpp] - -[section:address_range_v4 ip::address_range_v4::address_range_v4] - -[indexterm2 address_range_v4..ip::address_range_v4] -Construct an empty range. - - - ``[link asio.reference.ip__address_range_v4.address_range_v4.overload1 address_range_v4]``(); - `` [''''»''' [link asio.reference.ip__address_range_v4.address_range_v4.overload1 more...]]`` - - -Construct an range that represents the given range of addresses. - - - explicit ``[link asio.reference.ip__address_range_v4.address_range_v4.overload2 address_range_v4]``( - const address_iterator_v4 & first, - const address_iterator_v4 & last); - `` [''''»''' [link asio.reference.ip__address_range_v4.address_range_v4.overload2 more...]]`` - - -Copy constructor. - - - ``[link asio.reference.ip__address_range_v4.address_range_v4.overload3 address_range_v4]``( - const address_range_v4 & other); - `` [''''»''' [link asio.reference.ip__address_range_v4.address_range_v4.overload3 more...]]`` - - -[section:overload1 ip::address_range_v4::address_range_v4 (1 of 3 overloads)] - - -Construct an empty range. - - - address_range_v4(); - - - -[endsect] - - - -[section:overload2 ip::address_range_v4::address_range_v4 (2 of 3 overloads)] - - -Construct an range that represents the given range of addresses. - - - address_range_v4( - const address_iterator_v4 & first, - const address_iterator_v4 & last); - - - -[endsect] - - - -[section:overload3 ip::address_range_v4::address_range_v4 (3 of 3 overloads)] - - -Copy constructor. - - - address_range_v4( - const address_range_v4 & other); - - - -[endsect] - - -[endsect] - - -[section:begin ip::address_range_v4::begin] - -[indexterm2 begin..ip::address_range_v4] -Obtain an iterator that points to the start of the range. - - - iterator begin() const; - - - -[endsect] - - - -[section:empty ip::address_range_v4::empty] - -[indexterm2 empty..ip::address_range_v4] -Determine whether the range is empty. - - - bool empty() const; - - - -[endsect] - - - -[section:end ip::address_range_v4::end] - -[indexterm2 end..ip::address_range_v4] -Obtain an iterator that points to the end of the range. - - - iterator end() const; - - - -[endsect] - - - -[section:find ip::address_range_v4::find] - -[indexterm2 find..ip::address_range_v4] -Find an address in the range. - - - iterator find( - const address_v4 & addr) const; - - - -[endsect] - - - -[section:iterator ip::address_range_v4::iterator] - -[indexterm2 iterator..ip::address_range_v4] -The type of an iterator that points into the range. - - - typedef address_iterator_v4 iterator; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_iterator_v4.difference_type [*difference_type]]] - [Distance between two iterators. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.iterator_category [*iterator_category]]] - [Denotes that the iterator satisfies the input iterator requirements. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.pointer [*pointer]]] - [The type of a pointer to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.reference [*reference]]] - [The type of a reference to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v4.value_type [*value_type]]] - [The type of the elements pointed to by the iterator. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v4.address_iterator_v4 [*address_iterator_v4]]] - [Construct an iterator that points to the specified address. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator__star_ [*operator *]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_plus__plus_ [*operator++]]] - [Pre-increment operator. - - Post-increment operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_minus__minus_ [*operator--]]] - [Pre-decrement operator. - - Post-decrement operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_arrow_ [*operator->]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v4.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - -] - -In addition to satisfying the input iterator requirements, this iterator also supports decrement. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_range_v4.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:operator_eq_ ip::address_range_v4::operator=] - -[indexterm2 operator=..ip::address_range_v4] -Assignment operator. - - - address_range_v4 & operator=( - const address_range_v4 & other); - - - -[endsect] - - - -[section:size ip::address_range_v4::size] - -[indexterm2 size..ip::address_range_v4] -Return the size of the range. - - - std::size_t size() const; - - - -[endsect] - - - -[endsect] - -[section:ip__address_range_v6 ip::address_range_v6] - - -Represents a range of IPv6 addresses. - - - class address_range_v6 - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_range_v6.iterator [*iterator]]] - [The type of an iterator that points into the range. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_range_v6.address_range_v6 [*address_range_v6]]] - [Construct an empty range. - - Construct an range that represents the given range of addresses. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_range_v6.begin [*begin]]] - [Obtain an iterator that points to the start of the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v6.empty [*empty]]] - [Determine whether the range is empty. ] - ] - - [ - [[link asio.reference.ip__address_range_v6.end [*end]]] - [Obtain an iterator that points to the end of the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v6.find [*find]]] - [Find an address in the range. ] - ] - - [ - [[link asio.reference.ip__address_range_v6.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - -] - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - -[heading Requirements] - -['Header: ][^asio/ip/address_range_v6.hpp] - -['Convenience header: ][^asio.hpp] - -[section:address_range_v6 ip::address_range_v6::address_range_v6] - -[indexterm2 address_range_v6..ip::address_range_v6] -Construct an empty range. - - - ``[link asio.reference.ip__address_range_v6.address_range_v6.overload1 address_range_v6]``(); - `` [''''»''' [link asio.reference.ip__address_range_v6.address_range_v6.overload1 more...]]`` - - -Construct an range that represents the given range of addresses. - - - explicit ``[link asio.reference.ip__address_range_v6.address_range_v6.overload2 address_range_v6]``( - const address_iterator_v6 & first, - const address_iterator_v6 & last); - `` [''''»''' [link asio.reference.ip__address_range_v6.address_range_v6.overload2 more...]]`` - - -Copy constructor. - - - ``[link asio.reference.ip__address_range_v6.address_range_v6.overload3 address_range_v6]``( - const address_range_v6 & other); - `` [''''»''' [link asio.reference.ip__address_range_v6.address_range_v6.overload3 more...]]`` - - -[section:overload1 ip::address_range_v6::address_range_v6 (1 of 3 overloads)] - - -Construct an empty range. - - - address_range_v6(); - - - -[endsect] - - - -[section:overload2 ip::address_range_v6::address_range_v6 (2 of 3 overloads)] - - -Construct an range that represents the given range of addresses. - - - address_range_v6( - const address_iterator_v6 & first, - const address_iterator_v6 & last); - - - -[endsect] - - - -[section:overload3 ip::address_range_v6::address_range_v6 (3 of 3 overloads)] - - -Copy constructor. - - - address_range_v6( - const address_range_v6 & other); - - - -[endsect] - - -[endsect] - - -[section:begin ip::address_range_v6::begin] - -[indexterm2 begin..ip::address_range_v6] -Obtain an iterator that points to the start of the range. - - - iterator begin() const; - - - -[endsect] - - - -[section:empty ip::address_range_v6::empty] - -[indexterm2 empty..ip::address_range_v6] -Determine whether the range is empty. - - - bool empty() const; - - - -[endsect] - - - -[section:end ip::address_range_v6::end] - -[indexterm2 end..ip::address_range_v6] -Obtain an iterator that points to the end of the range. - - - iterator end() const; - - - -[endsect] - - - -[section:find ip::address_range_v6::find] - -[indexterm2 find..ip::address_range_v6] -Find an address in the range. - - - iterator find( - const address_v6 & addr) const; - - - -[endsect] - - - -[section:iterator ip::address_range_v6::iterator] - -[indexterm2 iterator..ip::address_range_v6] -The type of an iterator that points into the range. - - - typedef address_iterator_v6 iterator; - - -[heading Types] -[table - [[Name][Description]] - - [ - - [[link asio.reference.ip__address_iterator_v6.difference_type [*difference_type]]] - [Distance between two iterators. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.iterator_category [*iterator_category]]] - [Denotes that the iterator satisfies the input iterator requirements. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.pointer [*pointer]]] - [The type of a pointer to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.reference [*reference]]] - [The type of a reference to an element pointed to by the iterator. ] - - ] - - [ - - [[link asio.reference.ip__address_iterator_v6.value_type [*value_type]]] - [The type of the elements pointed to by the iterator. ] - - ] - -] - -[heading Member Functions] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v6.address_iterator_v6 [*address_iterator_v6]]] - [Construct an iterator that points to the specified address. - - Copy constructor. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator__star_ [*operator *]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_plus__plus_ [*operator++]]] - [Pre-increment operator. - - Post-increment operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_minus__minus_ [*operator--]]] - [Pre-decrement operator. - - Post-decrement operator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_arrow_ [*operator->]]] - [Dereference the iterator. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_eq_ [*operator=]]] - [Assignment operator. ] - ] - -] - -[heading Friends] -[table - [[Name][Description]] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_not__eq_ [*operator!=]]] - [Compare two addresses for inequality. ] - ] - - [ - [[link asio.reference.ip__address_iterator_v6.operator_eq__eq_ [*operator==]]] - [Compare two addresses for equality. ] - ] - -] - -In addition to satisfying the input iterator requirements, this iterator also supports decrement. - - -[heading Thread Safety] - -['Distinct] ['objects:] Safe. - -['Shared] ['objects:] Unsafe. - - - - -[heading Requirements] - -['Header: ][^asio/ip/address_range_v6.hpp] - -['Convenience header: ][^asio.hpp] - - -[endsect] - - - -[section:operator_eq_ ip::address_range_v6::operator=] - -[indexterm2 operator=..ip::address_range_v6] -Assignment operator. - - - address_range_v6 & operator=( - const address_range_v6 & other); - - - -[endsect] - - - -[endsect] - [section:ip__address_v4 ip::address_v4] @@ -74586,6 +73720,13 @@ ] + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + ] [heading Member Functions] @@ -74598,7 +73739,7 @@ Construct an address from raw bytes. - Construct an address from an unsigned long in host byte order. + Construct an address from an unsigned integer in host byte order. Copy constructor. ] ] @@ -74612,7 +73753,7 @@ [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] [Obtain an address object that represents the broadcast address. - Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] ] [ @@ -74622,17 +73763,17 @@ [ [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] - [Determine whether the address is a class A address. ] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] ] [ [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] - [Determine whether the address is a class B address. ] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] ] [ [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] - [Determine whether the address is a class C address. ] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] ] [ @@ -74657,7 +73798,7 @@ [ [[link asio.reference.ip__address_v4.netmask [*netmask]]] - [Obtain the netmask that corresponds to the address, based on its address class. ] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] ] [ @@ -74672,7 +73813,14 @@ [ [[link asio.reference.ip__address_v4.to_string [*to_string]]] - [Get the address as a string in dotted decimal format. ] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] ] [ @@ -74726,7 +73874,7 @@ [[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 unsigned integer in host byte order. Create an IPv4 address from an IP address string in dotted decimal form. @@ -74784,11 +73932,11 @@ `` [''''»''' [link asio.reference.ip__address_v4.address_v4.overload2 more...]]`` -Construct an address from an unsigned long in host byte order. +Construct an address from an unsigned integer in host byte order. explicit ``[link asio.reference.ip__address_v4.address_v4.overload3 address_v4]``( - unsigned long addr); + uint_type addr); `` [''''»''' [link asio.reference.ip__address_v4.address_v4.overload3 more...]]`` @@ -74832,11 +73980,11 @@ [section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)] -Construct an address from an unsigned long in host byte order. +Construct an address from an unsigned integer in host byte order. address_v4( - unsigned long addr); + uint_type addr); @@ -74884,7 +74032,7 @@ `` [''''»''' [link asio.reference.ip__address_v4.broadcast.overload1 more...]]`` -Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. static address_v4 ``[link asio.reference.ip__address_v4.broadcast.overload2 broadcast]``( @@ -74910,7 +74058,7 @@ [section:overload2 ip::address_v4::broadcast (2 of 2 overloads)] -Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. static address_v4 broadcast( @@ -75044,7 +74192,7 @@ [section:is_class_a ip::address_v4::is_class_a] [indexterm2 is_class_a..ip::address_v4] -Determine whether the address is a class A address. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Determine whether the address is a class A address. bool is_class_a() const; @@ -75058,7 +74206,7 @@ [section:is_class_b ip::address_v4::is_class_b] [indexterm2 is_class_b..ip::address_v4] -Determine whether the address is a class B address. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Determine whether the address is a class B address. bool is_class_b() const; @@ -75072,7 +74220,7 @@ [section:is_class_c ip::address_v4::is_class_c] [indexterm2 is_class_c..ip::address_v4] -Determine whether the address is a class C address. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Determine whether the address is a class C address. bool is_class_c() const; @@ -75149,11 +74297,11 @@ `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload1 more...]]`` -Create an IPv4 address from an unsigned long in host byte order. +Create an IPv4 address from an unsigned integer in host byte order. address_v4 ``[link asio.reference.ip__address_v4.make_address_v4.overload2 make_address_v4]``( - unsigned long addr); + address_v4::uint_type addr); `` [''''»''' [link asio.reference.ip__address_v4.make_address_v4.overload2 more...]]`` @@ -75206,11 +74354,11 @@ [section:overload2 ip::address_v4::make_address_v4 (2 of 7 overloads)] -Create an IPv4 address from an unsigned long in host byte order. +Create an IPv4 address from an unsigned integer in host byte order. address_v4 make_address_v4( - unsigned long addr); + address_v4::uint_type addr); @@ -75355,7 +74503,7 @@ [section:netmask ip::address_v4::netmask] [indexterm2 netmask..ip::address_v4] -Obtain the netmask that corresponds to the address, based on its address class. +(Deprecated: Use [link asio.reference.ip__network_v4 `ip::network_v4`] class.) Obtain the netmask that corresponds to the address, based on its address class. static address_v4 netmask( @@ -75644,6 +74792,10 @@ std::string ``[link asio.reference.ip__address_v4.to_string.overload1 to_string]``() const; `` [''''»''' [link asio.reference.ip__address_v4.to_string.overload1 more...]]`` + +(Deprecated: Use other overload.) Get the address as a string in dotted decimal format. + + std::string ``[link asio.reference.ip__address_v4.to_string.overload2 to_string]``( asio::error_code & ec) const; `` [''''»''' [link asio.reference.ip__address_v4.to_string.overload2 more...]]`` @@ -75666,7 +74818,7 @@ [section:overload2 ip::address_v4::to_string (2 of 2 overloads)] -Get the address as a string in dotted decimal format. +(Deprecated: Use other overload.) Get the address as a string in dotted decimal format. std::string to_string( @@ -75680,6 +74832,20 @@ [endsect] +[section:to_uint ip::address_v4::to_uint] + +[indexterm2 to_uint..ip::address_v4] +Get the address as an unsigned integer in host byte order. + + + uint_type to_uint() const; + + + +[endsect] + + + [section:to_ulong ip::address_v4::to_ulong] [indexterm2 to_ulong..ip::address_v4] @@ -75694,8 +74860,469 @@ +[section:uint_type ip::address_v4::uint_type] + +[indexterm2 uint_type..ip::address_v4] +The type used to represent an address as an unsigned integer. + + + typedef uint_least32_t uint_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4.hpp] + +['Convenience header: ][^asio.hpp] + + [endsect] + + +[endsect] + + +[section:ip__address_v4_iterator ip::address_v4_iterator] + +[indexterm1 ip::address_v4_iterator] +An input iterator that can be used for traversing IPv4 addresses. + + + typedef basic_address_iterator< address_v4 > address_v4_iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] + [Default constructor. + + Construct an address from raw bytes. + + Construct an address from an unsigned integer in host byte order. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v4.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] + [Obtain an address object that represents the broadcast address. + + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.from_string [*from_string]]] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v4.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.netmask [*netmask]]] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_string [*to_string]]] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] + [Get the address as an unsigned long in host byte order. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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 integer in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. + + Create an IPv4 address from a IPv4-mapped IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] + [Create an IPv4 network from an address and prefix length. + + Create an IPv4 network from an address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:ip__address_v4_range ip::address_v4_range] + +[indexterm1 ip::address_v4_range] +Represents a range of IPv4 addresses. + + + typedef basic_address_range< address_v4 > address_v4_range; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] + [Default constructor. + + Construct an address from raw bytes. + + Construct an address from an unsigned integer in host byte order. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v4.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] + [Obtain an address object that represents the broadcast address. + + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.from_string [*from_string]]] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v4.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.netmask [*netmask]]] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_string [*to_string]]] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] + [Get the address as an unsigned long in host byte order. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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 integer in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. + + Create an IPv4 address from a IPv4-mapped IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] + [Create an IPv4 network from an address and prefix length. + + Create an IPv4 network from an address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_range.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:ip__address_v6 ip::address_v6] @@ -75823,7 +75450,9 @@ [ [[link asio.reference.ip__address_v6.to_string [*to_string]]] - [Get the address as a string. ] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] ] [ @@ -76794,6 +76423,10 @@ std::string ``[link asio.reference.ip__address_v6.to_string.overload1 to_string]``() const; `` [''''»''' [link asio.reference.ip__address_v6.to_string.overload1 more...]]`` + +(Deprecated: Use other overload.) Get the address as a string. + + std::string ``[link asio.reference.ip__address_v6.to_string.overload2 to_string]``( asio::error_code & ec) const; `` [''''»''' [link asio.reference.ip__address_v6.to_string.overload2 more...]]`` @@ -76816,7 +76449,7 @@ [section:overload2 ip::address_v6::to_string (2 of 2 overloads)] -Get the address as a string. +(Deprecated: Use other overload.) Get the address as a string. std::string to_string( @@ -76876,6 +76509,480 @@ [endsect] + +[section:ip__address_v6_iterator ip::address_v6_iterator] + +[indexterm1 ip::address_v6_iterator] +An input iterator that can be used for traversing IPv6 addresses. + + + typedef basic_address_iterator< address_v6 > address_v6_iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] + [Default constructor. + + Construct an address from raw bytes and scope ID. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v6.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v6.from_string [*from_string]]] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] + [Determine whether the address is link local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] + [Determine whether the address is a global multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] + [Determine whether the address is a link-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] + [Determine whether the address is a node-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] + [Determine whether the address is a org-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] + [Determine whether the address is a site-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] + [Determine whether the address is site local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] + [Determine whether the address is a mapped IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] + [The scope ID of the address. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_string [*to_string]]] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] + [(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]]] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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. + + Create an IPv4-mapped IPv6 address from an IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] + [Create an IPv6 network from an address and prefix length. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:ip__address_v6_range ip::address_v6_range] + +[indexterm1 ip::address_v6_range] +Represents a range of IPv6 addresses. + + + typedef basic_address_range< address_v6 > address_v6_range; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] + [Default constructor. + + Construct an address from raw bytes and scope ID. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v6.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v6.from_string [*from_string]]] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] + [Determine whether the address is link local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] + [Determine whether the address is a global multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] + [Determine whether the address is a link-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] + [Determine whether the address is a node-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] + [Determine whether the address is a org-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] + [Determine whether the address is a site-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] + [Determine whether the address is site local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] + [Determine whether the address is a mapped IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] + [The scope ID of the address. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_string [*to_string]]] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] + [(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]]] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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. + + Create an IPv4-mapped IPv6 address from an IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] + [Create an IPv6 network from an address and prefix length. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_range.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:ip__bad_address_cast ip::bad_address_cast] @@ -76957,6 +77064,2698 @@ [endsect] +[section:ip__basic_address_iterator_lt__address_v4__gt_ ip::basic_address_iterator< address_v4 >] + + +An input iterator that can be used for traversing IPv4 addresses. + + + template<> + class basic_address_iterator< address_v4 > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.difference_type [*difference_type]]] + [Distance between two iterators. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.iterator_category [*iterator_category]]] + [Denotes that the iterator satisfies the input iterator requirements. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.pointer [*pointer]]] + [The type of a pointer to an element pointed to by the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.reference [*reference]]] + [The type of a reference to an element pointed to by the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.value_type [*value_type]]] + [The type of the elements pointed to by the iterator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator [*basic_address_iterator]]] + [Construct an iterator that points to the specified address. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator__star_ [*operator *]]] + [Dereference the iterator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_plus__plus_ [*operator++]]] + [Pre-increment operator. + + Post-increment operator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_minus__minus_ [*operator--]]] + [Pre-decrement operator. + + Post-decrement operator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_arrow_ [*operator->]]] + [Dereference the iterator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq_ [*operator=]]] + [Assignment operator. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + +] + +In addition to satisfying the input iterator requirements, this iterator also supports decrement. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_address_iterator ip::basic_address_iterator< address_v4 >::basic_address_iterator] + +[indexterm2 basic_address_iterator..ip::basic_address_iterator< address_v4 >] +Construct an iterator that points to the specified address. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload1 basic_address_iterator]``( + const address_v4 & addr); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload2 basic_address_iterator]``( + const basic_address_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.basic_address_iterator.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v4 >::basic_address_iterator (1 of 2 overloads)] + + +Construct an iterator that points to the specified address. + + + basic_address_iterator( + const address_v4 & addr); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v4 >::basic_address_iterator (2 of 2 overloads)] + + +Copy constructor. + + + basic_address_iterator( + const basic_address_iterator & other); + + + +[endsect] + + +[endsect] + + +[section:difference_type ip::basic_address_iterator< address_v4 >::difference_type] + +[indexterm2 difference_type..ip::basic_address_iterator< address_v4 >] +Distance between two iterators. + + + typedef std::ptrdiff_t difference_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:iterator_category ip::basic_address_iterator< address_v4 >::iterator_category] + +[indexterm2 iterator_category..ip::basic_address_iterator< address_v4 >] +Denotes that the iterator satisfies the input iterator requirements. + + + typedef std::input_iterator_tag iterator_category; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator__star_ ip::basic_address_iterator< address_v4 >::operator *] + +[indexterm2 operator *..ip::basic_address_iterator< address_v4 >] +Dereference the iterator. + + + const address_v4 & operator *() const; + + + +[endsect] + + + +[section:operator_not__eq_ ip::basic_address_iterator< address_v4 >::operator!=] + +[indexterm2 operator!=..ip::basic_address_iterator< address_v4 >] +Compare two addresses for inequality. + + + friend bool operator!=( + const basic_address_iterator & a, + const basic_address_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:operator_plus__plus_ ip::basic_address_iterator< address_v4 >::operator++] + +[indexterm2 operator++..ip::basic_address_iterator< address_v4 >] +Pre-increment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_plus__plus_.overload1 operator++]``(); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_plus__plus_.overload1 more...]]`` + + +Post-increment operator. + + + basic_address_iterator ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_plus__plus_.overload2 operator++]``( + int ); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_plus__plus_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v4 >::operator++ (1 of 2 overloads)] + + +Pre-increment operator. + + + basic_address_iterator & operator++(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v4 >::operator++ (2 of 2 overloads)] + + +Post-increment operator. + + + basic_address_iterator operator++( + int ); + + + +[endsect] + + +[endsect] + +[section:operator_minus__minus_ ip::basic_address_iterator< address_v4 >::operator--] + +[indexterm2 operator--..ip::basic_address_iterator< address_v4 >] +Pre-decrement operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_minus__minus_.overload1 operator--]``(); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_minus__minus_.overload1 more...]]`` + + +Post-decrement operator. + + + basic_address_iterator ``[link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_minus__minus_.overload2 operator--]``( + int ); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v4__gt_.operator_minus__minus_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v4 >::operator-- (1 of 2 overloads)] + + +Pre-decrement operator. + + + basic_address_iterator & operator--(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v4 >::operator-- (2 of 2 overloads)] + + +Post-decrement operator. + + + basic_address_iterator operator--( + int ); + + + +[endsect] + + +[endsect] + + +[section:operator_arrow_ ip::basic_address_iterator< address_v4 >::operator->] + +[indexterm2 operator->..ip::basic_address_iterator< address_v4 >] +Dereference the iterator. + + + const address_v4 * operator->() const; + + + +[endsect] + + + +[section:operator_eq_ ip::basic_address_iterator< address_v4 >::operator=] + +[indexterm2 operator=..ip::basic_address_iterator< address_v4 >] +Assignment operator. + + + basic_address_iterator & operator=( + const basic_address_iterator & other); + + + +[endsect] + + + +[section:operator_eq__eq_ ip::basic_address_iterator< address_v4 >::operator==] + +[indexterm2 operator==..ip::basic_address_iterator< address_v4 >] +Compare two addresses for equality. + + + friend bool operator==( + const basic_address_iterator & a, + const basic_address_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:pointer ip::basic_address_iterator< address_v4 >::pointer] + +[indexterm2 pointer..ip::basic_address_iterator< address_v4 >] +The type of a pointer to an element pointed to by the iterator. + + + typedef const address_v4 * pointer; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:reference ip::basic_address_iterator< address_v4 >::reference] + +[indexterm2 reference..ip::basic_address_iterator< address_v4 >] +The type of a reference to an element pointed to by the iterator. + + + typedef const address_v4 & reference; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] + [Default constructor. + + Construct an address from raw bytes. + + Construct an address from an unsigned integer in host byte order. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v4.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] + [Obtain an address object that represents the broadcast address. + + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.from_string [*from_string]]] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v4.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.netmask [*netmask]]] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_string [*to_string]]] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] + [Get the address as an unsigned long in host byte order. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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 integer in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. + + Create an IPv4 address from a IPv4-mapped IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] + [Create an IPv4 network from an address and prefix length. + + Create an IPv4 network from an address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:value_type ip::basic_address_iterator< address_v4 >::value_type] + +[indexterm2 value_type..ip::basic_address_iterator< address_v4 >] +The type of the elements pointed to by the iterator. + + + typedef address_v4 value_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] + [Default constructor. + + Construct an address from raw bytes. + + Construct an address from an unsigned integer in host byte order. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v4.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] + [Obtain an address object that represents the broadcast address. + + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.from_string [*from_string]]] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v4.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.netmask [*netmask]]] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_string [*to_string]]] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] + [Get the address as an unsigned long in host byte order. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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 integer in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. + + Create an IPv4 address from a IPv4-mapped IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] + [Create an IPv4 network from an address and prefix length. + + Create an IPv4 network from an address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + +[section:ip__basic_address_iterator_lt__address_v6__gt_ ip::basic_address_iterator< address_v6 >] + + +An input iterator that can be used for traversing IPv6 addresses. + + + template<> + class basic_address_iterator< address_v6 > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.difference_type [*difference_type]]] + [Distance between two iterators. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.iterator_category [*iterator_category]]] + [Denotes that the iterator satisfies the input iterator requirements. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.pointer [*pointer]]] + [The type of a pointer to an element pointed to by the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.reference [*reference]]] + [The type of a reference to an element pointed to by the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.value_type [*value_type]]] + [The type of the elements pointed to by the iterator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator [*basic_address_iterator]]] + [Construct an iterator that points to the specified address. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator__star_ [*operator *]]] + [Dereference the iterator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_plus__plus_ [*operator++]]] + [Pre-increment operator. + + Post-increment operator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_minus__minus_ [*operator--]]] + [Pre-decrement operator. + + Post-decrement operator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_arrow_ [*operator->]]] + [Dereference the iterator. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq_ [*operator=]]] + [Assignment operator. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + +] + +In addition to satisfying the input iterator requirements, this iterator also supports decrement. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_address_iterator ip::basic_address_iterator< address_v6 >::basic_address_iterator] + +[indexterm2 basic_address_iterator..ip::basic_address_iterator< address_v6 >] +Construct an iterator that points to the specified address. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload1 basic_address_iterator]``( + const address_v6 & addr); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload2 basic_address_iterator]``( + const basic_address_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.basic_address_iterator.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v6 >::basic_address_iterator (1 of 2 overloads)] + + +Construct an iterator that points to the specified address. + + + basic_address_iterator( + const address_v6 & addr); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v6 >::basic_address_iterator (2 of 2 overloads)] + + +Copy constructor. + + + basic_address_iterator( + const basic_address_iterator & other); + + + +[endsect] + + +[endsect] + + +[section:difference_type ip::basic_address_iterator< address_v6 >::difference_type] + +[indexterm2 difference_type..ip::basic_address_iterator< address_v6 >] +Distance between two iterators. + + + typedef std::ptrdiff_t difference_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:iterator_category ip::basic_address_iterator< address_v6 >::iterator_category] + +[indexterm2 iterator_category..ip::basic_address_iterator< address_v6 >] +Denotes that the iterator satisfies the input iterator requirements. + + + typedef std::input_iterator_tag iterator_category; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator__star_ ip::basic_address_iterator< address_v6 >::operator *] + +[indexterm2 operator *..ip::basic_address_iterator< address_v6 >] +Dereference the iterator. + + + const address_v6 & operator *() const; + + + +[endsect] + + + +[section:operator_not__eq_ ip::basic_address_iterator< address_v6 >::operator!=] + +[indexterm2 operator!=..ip::basic_address_iterator< address_v6 >] +Compare two addresses for inequality. + + + friend bool operator!=( + const basic_address_iterator & a, + const basic_address_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[section:operator_plus__plus_ ip::basic_address_iterator< address_v6 >::operator++] + +[indexterm2 operator++..ip::basic_address_iterator< address_v6 >] +Pre-increment operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_plus__plus_.overload1 operator++]``(); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_plus__plus_.overload1 more...]]`` + + +Post-increment operator. + + + basic_address_iterator ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_plus__plus_.overload2 operator++]``( + int ); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_plus__plus_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v6 >::operator++ (1 of 2 overloads)] + + +Pre-increment operator. + + + basic_address_iterator & operator++(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v6 >::operator++ (2 of 2 overloads)] + + +Post-increment operator. + + + basic_address_iterator operator++( + int ); + + + +[endsect] + + +[endsect] + +[section:operator_minus__minus_ ip::basic_address_iterator< address_v6 >::operator--] + +[indexterm2 operator--..ip::basic_address_iterator< address_v6 >] +Pre-decrement operator. + + + basic_address_iterator & ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_minus__minus_.overload1 operator--]``(); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_minus__minus_.overload1 more...]]`` + + +Post-decrement operator. + + + basic_address_iterator ``[link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_minus__minus_.overload2 operator--]``( + int ); + `` [''''»''' [link asio.reference.ip__basic_address_iterator_lt__address_v6__gt_.operator_minus__minus_.overload2 more...]]`` + + +[section:overload1 ip::basic_address_iterator< address_v6 >::operator-- (1 of 2 overloads)] + + +Pre-decrement operator. + + + basic_address_iterator & operator--(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_iterator< address_v6 >::operator-- (2 of 2 overloads)] + + +Post-decrement operator. + + + basic_address_iterator operator--( + int ); + + + +[endsect] + + +[endsect] + + +[section:operator_arrow_ ip::basic_address_iterator< address_v6 >::operator->] + +[indexterm2 operator->..ip::basic_address_iterator< address_v6 >] +Dereference the iterator. + + + const address_v6 * operator->() const; + + + +[endsect] + + + +[section:operator_eq_ ip::basic_address_iterator< address_v6 >::operator=] + +[indexterm2 operator=..ip::basic_address_iterator< address_v6 >] +Assignment operator. + + + basic_address_iterator & operator=( + const basic_address_iterator & other); + + + +[endsect] + + + +[section:operator_eq__eq_ ip::basic_address_iterator< address_v6 >::operator==] + +[indexterm2 operator==..ip::basic_address_iterator< address_v6 >] +Compare two addresses for equality. + + + friend bool operator==( + const basic_address_iterator & a, + const basic_address_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:pointer ip::basic_address_iterator< address_v6 >::pointer] + +[indexterm2 pointer..ip::basic_address_iterator< address_v6 >] +The type of a pointer to an element pointed to by the iterator. + + + typedef const address_v6 * pointer; + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:reference ip::basic_address_iterator< address_v6 >::reference] + +[indexterm2 reference..ip::basic_address_iterator< address_v6 >] +The type of a reference to an element pointed to by the iterator. + + + typedef const address_v6 & reference; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] + [Default constructor. + + Construct an address from raw bytes and scope ID. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v6.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v6.from_string [*from_string]]] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] + [Determine whether the address is link local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] + [Determine whether the address is a global multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] + [Determine whether the address is a link-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] + [Determine whether the address is a node-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] + [Determine whether the address is a org-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] + [Determine whether the address is a site-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] + [Determine whether the address is site local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] + [Determine whether the address is a mapped IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] + [The scope ID of the address. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_string [*to_string]]] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] + [(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]]] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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. + + Create an IPv4-mapped IPv6 address from an IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] + [Create an IPv6 network from an address and prefix length. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:value_type ip::basic_address_iterator< address_v6 >::value_type] + +[indexterm2 value_type..ip::basic_address_iterator< address_v6 >] +The type of the elements pointed to by the iterator. + + + typedef address_v6 value_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] + [Default constructor. + + Construct an address from raw bytes and scope ID. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v6.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v6.from_string [*from_string]]] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] + [Determine whether the address is link local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] + [Determine whether the address is a global multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] + [Determine whether the address is a link-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] + [Determine whether the address is a node-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] + [Determine whether the address is a org-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] + [Determine whether the address is a site-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] + [Determine whether the address is site local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] + [Determine whether the address is a mapped IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] + [The scope ID of the address. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_string [*to_string]]] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] + [(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]]] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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. + + Create an IPv4-mapped IPv6 address from an IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] + [Create an IPv6 network from an address and prefix length. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_iterator.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[endsect] + +[section:ip__basic_address_range_lt__address_v4__gt_ ip::basic_address_range< address_v4 >] + + +Represents a range of IPv4 addresses. + + + template<> + class basic_address_range< address_v4 > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.iterator [*iterator]]] + [The type of an iterator that points into the range. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range [*basic_address_range]]] + [Construct an empty range. + + Construct an range that represents the given range of addresses. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.begin [*begin]]] + [Obtain an iterator that points to the start of the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.empty [*empty]]] + [Determine whether the range is empty. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.end [*end]]] + [Obtain an iterator that points to the end of the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.find [*find]]] + [Find an address in the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.operator_eq_ [*operator=]]] + [Assignment operator. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.size [*size]]] + [Return the size of the range. ] + ] + +] + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_range.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_address_range ip::basic_address_range< address_v4 >::basic_address_range] + +[indexterm2 basic_address_range..ip::basic_address_range< address_v4 >] +Construct an empty range. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload1 basic_address_range]``(); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload1 more...]]`` + + +Construct an range that represents the given range of addresses. + + + explicit ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload2 basic_address_range]``( + const iterator & first, + const iterator & last); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload2 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload3 basic_address_range]``( + const basic_address_range & other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v4__gt_.basic_address_range.overload3 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v4 >::basic_address_range (1 of 3 overloads)] + + +Construct an empty range. + + + basic_address_range(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_range< address_v4 >::basic_address_range (2 of 3 overloads)] + + +Construct an range that represents the given range of addresses. + + + basic_address_range( + const iterator & first, + const iterator & last); + + + +[endsect] + + + +[section:overload3 ip::basic_address_range< address_v4 >::basic_address_range (3 of 3 overloads)] + + +Copy constructor. + + + basic_address_range( + const basic_address_range & other); + + + +[endsect] + + +[endsect] + + +[section:begin ip::basic_address_range< address_v4 >::begin] + +[indexterm2 begin..ip::basic_address_range< address_v4 >] +Obtain an iterator that points to the start of the range. + + + iterator begin() const; + + + +[endsect] + + + +[section:empty ip::basic_address_range< address_v4 >::empty] + +[indexterm2 empty..ip::basic_address_range< address_v4 >] +Determine whether the range is empty. + + + bool empty() const; + + + +[endsect] + + + +[section:end ip::basic_address_range< address_v4 >::end] + +[indexterm2 end..ip::basic_address_range< address_v4 >] +Obtain an iterator that points to the end of the range. + + + iterator end() const; + + + +[endsect] + + + +[section:find ip::basic_address_range< address_v4 >::find] + +[indexterm2 find..ip::basic_address_range< address_v4 >] +Find an address in the range. + + + iterator find( + const address_v4 & addr) const; + + + +[endsect] + + + +[section:iterator ip::basic_address_range< address_v4 >::iterator] + +[indexterm2 iterator..ip::basic_address_range< address_v4 >] +The type of an iterator that points into the range. + + + typedef basic_address_iterator< address_v4 > iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v4.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + + [ + + [[link asio.reference.ip__address_v4.uint_type [*uint_type]]] + [The type used to represent an address as an unsigned integer. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.address_v4 [*address_v4]]] + [Default constructor. + + Construct an address from raw bytes. + + Construct an address from an unsigned integer in host byte order. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v4.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v4.broadcast [*broadcast]]] + [Obtain an address object that represents the broadcast address. + + (Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.from_string [*from_string]]] + [(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_a [*is_class_a]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class A address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_b [*is_class_b]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class B address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_class_c [*is_class_c]]] + [(Deprecated: Use network_v4 class.) Determine whether the address is a class C address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v4.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v4.netmask [*netmask]]] + [(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_string [*to_string]]] + [Get the address as a string in dotted decimal format. + + (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_uint [*to_uint]]] + [Get the address as an unsigned integer in host byte order. ] + ] + + [ + [[link asio.reference.ip__address_v4.to_ulong [*to_ulong]]] + [Get the address as an unsigned long in host byte order. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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 integer in host byte order. + + Create an IPv4 address from an IP address string in dotted decimal form. + + Create an IPv4 address from a IPv4-mapped IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v4.make_network_v4 [*make_network_v4]]] + [Create an IPv4 network from an address and prefix length. + + Create an IPv4 network from an address and netmask. ] + ] + + [ + [[link asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v4_range.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq_ ip::basic_address_range< address_v4 >::operator=] + +[indexterm2 operator=..ip::basic_address_range< address_v4 >] +Assignment operator. + + + basic_address_range & operator=( + const basic_address_range & other); + + + +[endsect] + + + +[section:size ip::basic_address_range< address_v4 >::size] + +[indexterm2 size..ip::basic_address_range< address_v4 >] +Return the size of the range. + + + std::size_t size() const; + + + +[endsect] + + + +[endsect] + +[section:ip__basic_address_range_lt__address_v6__gt_ ip::basic_address_range< address_v6 >] + + +Represents a range of IPv6 addresses. + + + template<> + class basic_address_range< address_v6 > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.iterator [*iterator]]] + [The type of an iterator that points into the range. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range [*basic_address_range]]] + [Construct an empty range. + + Construct an range that represents the given range of addresses. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.begin [*begin]]] + [Obtain an iterator that points to the start of the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.empty [*empty]]] + [Determine whether the range is empty. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.end [*end]]] + [Obtain an iterator that points to the end of the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.find [*find]]] + [Find an address in the range. ] + ] + + [ + [[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.operator_eq_ [*operator=]]] + [Assignment operator. ] + ] + +] + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_range.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_address_range ip::basic_address_range< address_v6 >::basic_address_range] + +[indexterm2 basic_address_range..ip::basic_address_range< address_v6 >] +Construct an empty range. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload1 basic_address_range]``(); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload1 more...]]`` + + +Construct an range that represents the given range of addresses. + + + explicit ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload2 basic_address_range]``( + const iterator & first, + const iterator & last); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload2 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload3 basic_address_range]``( + const basic_address_range & other); + `` [''''»''' [link asio.reference.ip__basic_address_range_lt__address_v6__gt_.basic_address_range.overload3 more...]]`` + + +[section:overload1 ip::basic_address_range< address_v6 >::basic_address_range (1 of 3 overloads)] + + +Construct an empty range. + + + basic_address_range(); + + + +[endsect] + + + +[section:overload2 ip::basic_address_range< address_v6 >::basic_address_range (2 of 3 overloads)] + + +Construct an range that represents the given range of addresses. + + + basic_address_range( + const iterator & first, + const iterator & last); + + + +[endsect] + + + +[section:overload3 ip::basic_address_range< address_v6 >::basic_address_range (3 of 3 overloads)] + + +Copy constructor. + + + basic_address_range( + const basic_address_range & other); + + + +[endsect] + + +[endsect] + + +[section:begin ip::basic_address_range< address_v6 >::begin] + +[indexterm2 begin..ip::basic_address_range< address_v6 >] +Obtain an iterator that points to the start of the range. + + + iterator begin() const; + + + +[endsect] + + + +[section:empty ip::basic_address_range< address_v6 >::empty] + +[indexterm2 empty..ip::basic_address_range< address_v6 >] +Determine whether the range is empty. + + + bool empty() const; + + + +[endsect] + + + +[section:end ip::basic_address_range< address_v6 >::end] + +[indexterm2 end..ip::basic_address_range< address_v6 >] +Obtain an iterator that points to the end of the range. + + + iterator end() const; + + + +[endsect] + + + +[section:find ip::basic_address_range< address_v6 >::find] + +[indexterm2 find..ip::basic_address_range< address_v6 >] +Find an address in the range. + + + iterator find( + const address_v6 & addr) const; + + + +[endsect] + + + +[section:iterator ip::basic_address_range< address_v6 >::iterator] + +[indexterm2 iterator..ip::basic_address_range< address_v6 >] +The type of an iterator that points into the range. + + + typedef basic_address_iterator< address_v6 > iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__address_v6.bytes_type [*bytes_type]]] + [The type used to represent an address as an array of bytes. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.address_v6 [*address_v6]]] + [Default constructor. + + Construct an address from raw bytes and scope ID. + + Copy constructor. ] + ] + + [ + [[link asio.reference.ip__address_v6.any [*any]]] + [Obtain an address object that represents any address. ] + ] + + [ + [[link asio.reference.ip__address_v6.from_string [*from_string]]] + [(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_link_local [*is_link_local]]] + [Determine whether the address is link local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_loopback [*is_loopback]]] + [Determine whether the address is a loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast [*is_multicast]]] + [Determine whether the address is a multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]] + [Determine whether the address is a global multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]] + [Determine whether the address is a link-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]] + [Determine whether the address is a node-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]] + [Determine whether the address is a org-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]] + [Determine whether the address is a site-local multicast address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_site_local [*is_site_local]]] + [Determine whether the address is site local. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]] + [Determine whether the address is unspecified. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]] + [(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. ] + ] + + [ + [[link asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]] + [Determine whether the address is a mapped IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.loopback [*loopback]]] + [Obtain an address object that represents the loopback address. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq_ [*operator=]]] + [Assign from another address. ] + ] + + [ + [[link asio.reference.ip__address_v6.scope_id [*scope_id]]] + [The scope ID of the address. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_bytes [*to_bytes]]] + [Get the address in bytes, in network byte order. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_string [*to_string]]] + [Get the address as a string. + + (Deprecated: Use other overload.) Get the address as a string. ] + ] + + [ + [[link asio.reference.ip__address_v6.to_v4 [*to_v4]]] + [(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]]] + [(Deprecated: No replacement.) Create an IPv4-compatible IPv6 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]] + [(Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]] + [Compare two addresses for inequality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt_ [*operator<]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]] + [Compare two addresses for equality. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt_ [*operator>]]] + [Compare addresses for ordering. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]] + [Compare addresses for ordering. ] + ] + +] + +[heading Related Functions] +[table + [[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. + + Create an IPv4-mapped IPv6 address from an IPv4 address. ] + ] + + [ + [[link asio.reference.ip__address_v6.make_network_v6 [*make_network_v6]]] + [Create an IPv6 network from an address and prefix length. ] + ] + + [ + [[link asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]] + [Output an address as a string. + + Output a network as a string. ] + ] + +] + +The [link asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/address_v6_range.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:operator_eq_ ip::basic_address_range< address_v6 >::operator=] + +[indexterm2 operator=..ip::basic_address_range< address_v6 >] +Assignment operator. + + + basic_address_range & operator=( + const basic_address_range & other); + + + +[endsect] + + + +[endsect] + [section:ip__basic_endpoint ip::basic_endpoint] @@ -77007,7 +79806,9 @@ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint. - Copy constructor. ] + Copy constructor. + + Move constructor. ] ] [ @@ -77022,7 +79823,9 @@ [ [[link asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + + Move-assign from another endpoint. ] ] [ @@ -77198,7 +80001,15 @@ `` [''''»''' [link asio.reference.ip__basic_endpoint.basic_endpoint.overload4 more...]]`` -[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)] +Move constructor. + + + ``[link asio.reference.ip__basic_endpoint.basic_endpoint.overload5 basic_endpoint]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.ip__basic_endpoint.basic_endpoint.overload5 more...]]`` + + +[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 5 overloads)] Default constructor. @@ -77212,7 +80023,7 @@ -[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)] +[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 5 overloads)] Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR\_ANY or in6addr\_any). This constructor would typically be used for accepting new connections. @@ -77245,7 +80056,7 @@ -[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)] +[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 5 overloads)] Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint. @@ -77261,7 +80072,7 @@ -[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)] +[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 5 overloads)] Copy constructor. @@ -77275,6 +80086,21 @@ [endsect] + +[section:overload5 ip::basic_endpoint::basic_endpoint (5 of 5 overloads)] + + +Move constructor. + + + basic_endpoint( + basic_endpoint && other); + + + +[endsect] + + [endsect] @@ -77457,13 +80283,31 @@ [endsect] - [section:operator_eq_ ip::basic_endpoint::operator=] [indexterm2 operator=..ip::basic_endpoint] Assign from another endpoint. + basic_endpoint & ``[link asio.reference.ip__basic_endpoint.operator_eq_.overload1 operator=]``( + const basic_endpoint & other); + `` [''''»''' [link asio.reference.ip__basic_endpoint.operator_eq_.overload1 more...]]`` + + +Move-assign from another endpoint. + + + basic_endpoint & ``[link asio.reference.ip__basic_endpoint.operator_eq_.overload2 operator=]``( + basic_endpoint && other); + `` [''''»''' [link asio.reference.ip__basic_endpoint.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_endpoint::operator= (1 of 2 overloads)] + + +Assign from another endpoint. + + basic_endpoint & operator=( const basic_endpoint & other); @@ -77473,6 +80317,23 @@ +[section:overload2 ip::basic_endpoint::operator= (2 of 2 overloads)] + + +Move-assign from another endpoint. + + + basic_endpoint & operator=( + basic_endpoint && other); + + + +[endsect] + + +[endsect] + + [section:operator_eq__eq_ ip::basic_endpoint::operator==] [indexterm2 operator==..ip::basic_endpoint] @@ -77663,7 +80524,8 @@ typename ``[link asio.reference.InternetProtocol InternetProtocol]``, typename ``[link asio.reference.ResolverService ResolverService]`` = resolver_service<InternetProtocol>> class basic_resolver : - public basic_io_object< ResolverService > + public basic_io_object< ResolverService >, + public ip::resolver_base [heading Types] @@ -77686,6 +80548,13 @@ [ + [[link asio.reference.ip__basic_resolver.flags [*flags]]] + [A bitmask type (C++ Std \[lib.bitmask.types\]). ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -77694,7 +80563,7 @@ [ [[link asio.reference.ip__basic_resolver.iterator [*iterator]]] - [The iterator type. ] + [(Deprecated.) The iterator type. ] ] @@ -77708,7 +80577,14 @@ [ [[link asio.reference.ip__basic_resolver.query [*query]]] - [The query type. ] + [(Deprecated.) The query type. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver.results_type [*results_type]]] + [The results type. ] ] @@ -77727,7 +80603,9 @@ [ [[link asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]] - [Asynchronously perform forward resolution of a query to a list of entries. + [(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. + + Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. ] ] @@ -77748,13 +80626,20 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ [[link asio.reference.ip__basic_resolver.resolve [*resolve]]] - [Perform forward resolution of a query to a list of entries. + [(Deprecated.) Perform forward resolution of a query to a list of entries. + + Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. ] ] @@ -77777,6 +80662,47 @@ ] +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver.address_configured [*address_configured]]] + [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.all_matching [*all_matching]]] + [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.canonical_name [*canonical_name]]] + [Determine the canonical name of the host specified in the query. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_host [*numeric_host]]] + [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_service [*numeric_service]]] + [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.passive [*passive]]] + [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.v4_mapped [*v4_mapped]]] + [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ] + ] + +] + The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -77794,10 +80720,44 @@ ['Convenience header: ][^asio.hpp] + +[section:address_configured ip::basic_resolver::address_configured] + + +['Inherited from ip::resolver_base.] + +[indexterm2 address_configured..ip::basic_resolver] +Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. + + + static const flags address_configured = implementation_defined; + + + +[endsect] + + + +[section:all_matching ip::basic_resolver::all_matching] + + +['Inherited from ip::resolver_base.] + +[indexterm2 all_matching..ip::basic_resolver] +If used with v4\_mapped, return all matching IPv6 and IPv4 addresses. + + + static const flags all_matching = implementation_defined; + + + +[endsect] + + [section:async_resolve ip::basic_resolver::async_resolve] [indexterm2 async_resolve..ip::basic_resolver] -Asynchronously perform forward resolution of a query to a list of entries. +(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. template< @@ -77808,21 +80768,61 @@ `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload1 more...]]`` -Asynchronously perform reverse resolution of an endpoint to a list of entries. +Asynchronously perform forward resolution of a query to a list of entries. template< typename ``[link asio.reference.ResolveHandler ResolveHandler]``> ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload2 async_resolve]``( - const endpoint_type & e, + const std::string & host, + const std::string & service, ResolveHandler && handler); `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload2 more...]]`` + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload3 async_resolve]``( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + ResolveHandler && handler); + `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload3 more...]]`` -[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)] + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload4 async_resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + ResolveHandler && handler); + `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload4 more...]]`` + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload5 async_resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + ResolveHandler && handler); + `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload5 more...]]`` -Asynchronously perform forward resolution of a query to a list of entries. +Asynchronously perform reverse resolution of an endpoint to a list of entries. + + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` ``[link asio.reference.ip__basic_resolver.async_resolve.overload6 async_resolve]``( + const endpoint_type & e, + ResolveHandler && handler); + `` [''''»''' [link asio.reference.ip__basic_resolver.async_resolve.overload6 more...]]`` + + +[section:overload1 ip::basic_resolver::async_resolve (1 of 6 overloads)] + + +(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. template< @@ -77846,28 +80846,237 @@ `` void handler( const asio::error_code& error, // Result of operation. - resolver::iterator iterator // Forward-only iterator that can - // be used to traverse the list - // of endpoint entries. + resolver::results_type results // Resolved endpoints as a range. ); `` -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()`.]] +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_context::post()`.]] ] - -[heading Remarks] - -A default constructed iterator represents the end of the list. - -A successful resolve operation is guaranteed to pass at least one entry to the handler. +A successful resolve operation is guaranteed to pass a non-empty range to the handler. [endsect] -[section:overload2 ip::basic_resolver::async_resolve (2 of 2 overloads)] +[section:overload2 ip::basic_resolver::async_resolve (2 of 6 overloads)] + + +Asynchronously perform forward resolution of a query to a list of entries. + + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_resolve( + const std::string & host, + const std::string & service, + ResolveHandler && handler); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[handler][The handler to be called when the resolve 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. + resolver::results_type results // Resolved endpoints as a range. + ); +`` +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_context::post()`.]] + +] + +A successful resolve operation is guaranteed to pass a non-empty range to the handler. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload3 ip::basic_resolver::async_resolve (3 of 6 overloads)] + + +Asynchronously perform forward resolution of a query to a list of entries. + + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_resolve( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + ResolveHandler && handler); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +[[handler][The handler to be called when the resolve 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. + resolver::results_type results // Resolved endpoints as a range. + ); +`` +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_context::post()`.]] + +] + +A successful resolve operation is guaranteed to pass a non-empty range to the handler. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload4 ip::basic_resolver::async_resolve (4 of 6 overloads)] + + +Asynchronously perform forward resolution of a query to a list of entries. + + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + ResolveHandler && handler); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[handler][The handler to be called when the resolve 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. + resolver::results_type results // Resolved endpoints as a range. + ); +`` +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_context::post()`.]] + +] + +A successful resolve operation is guaranteed to pass a non-empty range to the handler. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload5 ip::basic_resolver::async_resolve (5 of 6 overloads)] + + +Asynchronously perform forward resolution of a query to a list of entries. + + + template< + typename ``[link asio.reference.ResolveHandler ResolveHandler]``> + ``[link asio.reference.asynchronous_operations.return_type_of_an_initiating_function ['void-or-deduced]]`` async_resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + ResolveHandler && handler); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +[[handler][The handler to be called when the resolve 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. + resolver::results_type results // Resolved endpoints as a range. + ); +`` +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_context::post()`.]] + +] + +A successful resolve operation is guaranteed to pass a non-empty range to the handler. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload6 ip::basic_resolver::async_resolve (6 of 6 overloads)] Asynchronously perform reverse resolution of an endpoint to a list of entries. @@ -77894,21 +81103,14 @@ `` void handler( const asio::error_code& error, // Result of operation. - resolver::iterator iterator // Forward-only iterator that can - // be used to traverse the list - // of endpoint entries. + resolver::results_type results // Resolved endpoints as a range. ); `` -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()`.]] +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_context::post()`.]] ] - -[heading Remarks] - -A default constructed iterator represents the end of the list. - -A successful resolve operation is guaranteed to pass at least one entry to the handler. +A successful resolve operation is guaranteed to pass a non-empty range to the handler. [endsect] @@ -77924,7 +81126,7 @@ basic_resolver( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a [link asio.reference.ip__basic_resolver `ip::basic_resolver`]. @@ -77935,7 +81137,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]] ] @@ -77962,6 +81164,23 @@ +[section:canonical_name ip::basic_resolver::canonical_name] + + +['Inherited from ip::resolver_base.] + +[indexterm2 canonical_name..ip::basic_resolver] +Determine the canonical name of the host specified in the query. + + + static const flags canonical_name = implementation_defined; + + + +[endsect] + + + [section:endpoint_type ip::basic_resolver::endpoint_type] [indexterm2 endpoint_type..ip::basic_resolver] @@ -77992,7 +81211,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -78000,38 +81219,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -78041,12 +81260,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -78064,6 +81283,30 @@ +[section:flags ip::basic_resolver::flags] + + +['Inherited from ip::resolver_base.] + +[indexterm2 flags..ip::basic_resolver] +A bitmask type (C++ Std [lib.bitmask.types]). + + + typedef unspecified flags; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:get_executor ip::basic_resolver::get_executor] @@ -78129,24 +81372,50 @@ [endsect] +[section:get_io_context ip::basic_resolver::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..ip::basic_resolver] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service ip::basic_resolver::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..ip::basic_resolver] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -78230,7 +81499,7 @@ [section:iterator ip::basic_resolver::iterator] [indexterm2 iterator..ip::basic_resolver] -The iterator type. +(Deprecated.) The iterator type. typedef basic_resolver_iterator< InternetProtocol > iterator; @@ -78283,16 +81552,11 @@ [ [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]] - [Default constructor creates an end iterator. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.create [*create]]] - [Create an iterator from an addrinfo list returned by getaddrinfo. + [Default constructor creates an end iterator. - Create an iterator from an endpoint, host name and service name. + Copy constructor. - Create an iterator from a sequence of endpoints, host and service name. ] + Move constructor. ] ] [ @@ -78312,6 +81576,50 @@ [Dereference an iterator. ] ] + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] + [] + ] + ] [heading Friends] @@ -78360,6 +81668,57 @@ +[section:numeric_host ip::basic_resolver::numeric_host] + + +['Inherited from ip::resolver_base.] + +[indexterm2 numeric_host..ip::basic_resolver] +Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. + + + static const flags numeric_host = implementation_defined; + + + +[endsect] + + + +[section:numeric_service ip::basic_resolver::numeric_service] + + +['Inherited from ip::resolver_base.] + +[indexterm2 numeric_service..ip::basic_resolver] +Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. + + + static const flags numeric_service = implementation_defined; + + + +[endsect] + + + +[section:passive ip::basic_resolver::passive] + + +['Inherited from ip::resolver_base.] + +[indexterm2 passive..ip::basic_resolver] +Indicate that returned endpoint is intended for use as a locally bound socket endpoint. + + + static const flags passive = implementation_defined; + + + +[endsect] + + + [section:protocol_type ip::basic_resolver::protocol_type] [indexterm2 protocol_type..ip::basic_resolver] @@ -78384,7 +81743,7 @@ [section:query ip::basic_resolver::query] [indexterm2 query..ip::basic_resolver] -The query type. +(Deprecated.) The query type. typedef basic_resolver_query< InternetProtocol > query; @@ -78508,39 +81867,95 @@ [section:resolve ip::basic_resolver::resolve] [indexterm2 resolve..ip::basic_resolver] -Perform forward resolution of a query to a list of entries. +(Deprecated.) Perform forward resolution of a query to a list of entries. - iterator ``[link asio.reference.ip__basic_resolver.resolve.overload1 resolve]``( + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload1 resolve]``( const query & q); `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload1 more...]]`` - iterator ``[link asio.reference.ip__basic_resolver.resolve.overload2 resolve]``( + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload2 resolve]``( const query & q, asio::error_code & ec); `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload2 more...]]`` -Perform reverse resolution of an endpoint to a list of entries. - - - iterator ``[link asio.reference.ip__basic_resolver.resolve.overload3 resolve]``( - const endpoint_type & e); - `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload3 more...]]`` - - iterator ``[link asio.reference.ip__basic_resolver.resolve.overload4 resolve]``( - const endpoint_type & e, - asio::error_code & ec); - `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload4 more...]]`` - - -[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)] - - Perform forward resolution of a query to a list of entries. - iterator resolve( + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload3 resolve]``( + const std::string & host, + const std::string & service); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload3 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload4 resolve]``( + const std::string & host, + const std::string & service, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload4 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload5 resolve]``( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload5 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload6 resolve]``( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload6 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload7 resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload7 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload8 resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload8 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload9 resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload9 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload10 resolve]``( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload10 more...]]`` + + +Perform reverse resolution of an endpoint to a list of entries. + + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload11 resolve]``( + const endpoint_type & e); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload11 more...]]`` + + results_type ``[link asio.reference.ip__basic_resolver.resolve.overload12 resolve]``( + const endpoint_type & e, + asio::error_code & ec); + `` [''''»''' [link asio.reference.ip__basic_resolver.resolve.overload12 more...]]`` + + +[section:overload1 ip::basic_resolver::resolve (1 of 12 overloads)] + + +(Deprecated.) Perform forward resolution of a query to a list of entries. + + + results_type resolve( const query & q); @@ -78559,7 +81974,7 @@ [heading Return Value] -A forward-only iterator that can be used to traverse the list of endpoint entries. +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. [heading Exceptions] @@ -78567,29 +81982,24 @@ [variablelist -[[asio::system_error][Thrown on failure.]] +[[asio::system_error][Thrown on failure. ]] ] -[heading Remarks] - -A default constructed iterator represents the end of the list. - -A successful call to this function is guaranteed to return at least one entry. [endsect] -[section:overload2 ip::basic_resolver::resolve (2 of 4 overloads)] +[section:overload2 ip::basic_resolver::resolve (2 of 12 overloads)] -Perform forward resolution of a query to a list of entries. +(Deprecated.) Perform forward resolution of a query to a list of entries. - iterator resolve( + results_type resolve( const query & q, asio::error_code & ec); @@ -78611,27 +82021,434 @@ [heading Return Value] -A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs. +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. -[heading Remarks] - -A default constructed iterator represents the end of the list. - -A successful call to this function is guaranteed to return at least one entry. [endsect] -[section:overload3 ip::basic_resolver::resolve (3 of 4 overloads)] +[section:overload3 ip::basic_resolver::resolve (3 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const std::string & host, + const std::string & service); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload4 ip::basic_resolver::resolve (4 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const std::string & host, + const std::string & service, + asio::error_code & ec); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload5 ip::basic_resolver::resolve (5 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload6 ip::basic_resolver::resolve (6 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + asio::error_code & ec); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload7 ip::basic_resolver::resolve (7 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload8 ip::basic_resolver::resolve (8 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + asio::error_code & ec); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload9 ip::basic_resolver::resolve (9 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Exceptions] + + +[variablelist + +[[asio::system_error][Thrown on failure.]] + +] + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload10 ip::basic_resolver::resolve (10 of 12 overloads)] + + +Perform forward resolution of a query to a list of entries. + + + results_type resolve( + const protocol_type & protocol, + const std::string & host, + const std::string & service, + resolver_base::flags resolve_flags, + asio::error_code & ec); + + +This function is used to resolve host and service names into a list of endpoint entries. + + +[heading Parameters] + + +[variablelist + +[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]] + +[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]] + +[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]] + +[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]] + +[[ec][Set to indicate what error occurred, if any.]] + +] + + +[heading Return Value] + +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. + + +[heading Remarks] + +On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows). + +On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names. + + +[endsect] + + + +[section:overload11 ip::basic_resolver::resolve (11 of 12 overloads)] Perform reverse resolution of an endpoint to a list of entries. - iterator resolve( + results_type resolve( const endpoint_type & e); @@ -78650,7 +82467,7 @@ [heading Return Value] -A forward-only iterator that can be used to traverse the list of endpoint entries. +A range object representing the list of endpoint entries. A successful call to this function is guaranteed to return a non-empty range. [heading Exceptions] @@ -78658,29 +82475,24 @@ [variablelist -[[asio::system_error][Thrown on failure.]] +[[asio::system_error][Thrown on failure. ]] ] -[heading Remarks] - -A default constructed iterator represents the end of the list. - -A successful call to this function is guaranteed to return at least one entry. [endsect] -[section:overload4 ip::basic_resolver::resolve (4 of 4 overloads)] +[section:overload12 ip::basic_resolver::resolve (12 of 12 overloads)] Perform reverse resolution of an endpoint to a list of entries. - iterator resolve( + results_type resolve( const endpoint_type & e, asio::error_code & ec); @@ -78702,21 +82514,275 @@ [heading Return Value] -A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs. +A range object representing the list of endpoint entries. An empty range is returned if an error occurs. A successful call to this function is guaranteed to return a non-empty range. + + + + +[endsect] + + +[endsect] + + +[section:results_type ip::basic_resolver::results_type] + +[indexterm2 results_type..ip::basic_resolver] +The results type. + + + typedef basic_resolver_results< InternetProtocol > results_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_iterator [*const_iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_reference [*const_reference]]] + [The type of a const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.difference_type [*difference_type]]] + [Type used to represent the distance between two iterators in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator [*iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator_category [*iterator_category]]] + [The iterator category. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.pointer [*pointer]]] + [The type of the result of applying operator->() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.protocol_type [*protocol_type]]] + [The protocol type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.reference [*reference]]] + [The type of a non-const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.size_type [*size_type]]] + [Type used to represent a count of the elements in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.value_type [*value_type]]] + [The type of a value in the results range. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.basic_resolver_results [*basic_resolver_results]]] + [Default constructor creates an empty range. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.begin [*begin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cbegin [*cbegin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cend [*cend]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.empty [*empty]]] + [Determine whether the results range is empty. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.end [*end]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.max_size [*max_size]]] + [Get the maximum number of entries permitted in a results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator__star_ [*operator *]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_plus__plus_ [*operator++]]] + [Increment operator (prefix). + + Increment operator (postfix). ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_arrow_ [*operator->]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.size [*size]]] + [Get the number of entries in the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.swap [*swap]]] + [Swap the results range with another. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.values_ [*values_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_not__eq_ [*operator!=]]] + [Test two iterators for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq__eq_ [*operator==]]] + [Test two iterators for equality. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] class template is used to define a range over the results returned by a resolver. + +The iterator's value\_type, obtained when a results iterator is dereferenced, is: + + const basic_resolver_entry<InternetProtocol> + + + [heading Remarks] -A default constructed iterator represents the end of the list. +For backward compatibility, [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] is derived from [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`]. This derivation is deprecated. -A successful call to this function is guaranteed to return at least one entry. + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver.hpp] + +['Convenience header: ][^asio.hpp] [endsect] -[endsect] - [section:service_type ip::basic_resolver::service_type] @@ -78742,6 +82808,23 @@ +[section:v4_mapped ip::basic_resolver::v4_mapped] + + +['Inherited from ip::resolver_base.] + +[indexterm2 v4_mapped..ip::basic_resolver] +If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. + + + static const flags v4_mapped = implementation_defined; + + + +[endsect] + + + [endsect] [section:ip__basic_resolver_entry ip::basic_resolver_entry] @@ -78912,13 +82995,28 @@ [endsect] - [section:host_name ip::basic_resolver_entry::host_name] [indexterm2 host_name..ip::basic_resolver_entry] Get the host name associated with the entry. + std::string ``[link asio.reference.ip__basic_resolver_entry.host_name.overload1 host_name]``() const; + `` [''''»''' [link asio.reference.ip__basic_resolver_entry.host_name.overload1 more...]]`` + + template< + class Allocator> + std::basic_string< char, std::char_traits< char >, Allocator > ``[link asio.reference.ip__basic_resolver_entry.host_name.overload2 host_name]``( + const Allocator & alloc = Allocator()) const; + `` [''''»''' [link asio.reference.ip__basic_resolver_entry.host_name.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_entry::host_name (1 of 2 overloads)] + + +Get the host name associated with the entry. + + std::string host_name() const; @@ -78927,6 +83025,25 @@ +[section:overload2 ip::basic_resolver_entry::host_name (2 of 2 overloads)] + + +Get the host name associated with the entry. + + + template< + class Allocator> + std::basic_string< char, std::char_traits< char >, Allocator > host_name( + const Allocator & alloc = Allocator()) const; + + + +[endsect] + + +[endsect] + + [section:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type] [indexterm2 operator endpoint_type..ip::basic_resolver_entry] @@ -78961,13 +83078,28 @@ [endsect] - [section:service_name ip::basic_resolver_entry::service_name] [indexterm2 service_name..ip::basic_resolver_entry] Get the service name associated with the entry. + std::string ``[link asio.reference.ip__basic_resolver_entry.service_name.overload1 service_name]``() const; + `` [''''»''' [link asio.reference.ip__basic_resolver_entry.service_name.overload1 more...]]`` + + template< + class Allocator> + std::basic_string< char, std::char_traits< char >, Allocator > ``[link asio.reference.ip__basic_resolver_entry.service_name.overload2 service_name]``( + const Allocator & alloc = Allocator()) const; + `` [''''»''' [link asio.reference.ip__basic_resolver_entry.service_name.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_entry::service_name (1 of 2 overloads)] + + +Get the service name associated with the entry. + + std::string service_name() const; @@ -78976,6 +83108,25 @@ +[section:overload2 ip::basic_resolver_entry::service_name (2 of 2 overloads)] + + +Get the service name associated with the entry. + + + template< + class Allocator> + std::basic_string< char, std::char_traits< char >, Allocator > service_name( + const Allocator & alloc = Allocator()) const; + + + +[endsect] + + +[endsect] + + [endsect] [section:ip__basic_resolver_iterator ip::basic_resolver_iterator] @@ -79036,16 +83187,11 @@ [ [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]] - [Default constructor creates an end iterator. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.create [*create]]] - [Create an iterator from an addrinfo list returned by getaddrinfo. + [Default constructor creates an end iterator. - Create an iterator from an endpoint, host name and service name. + Copy constructor. - Create an iterator from a sequence of endpoints, host and service name. ] + Move constructor. ] ] [ @@ -79065,6 +83211,50 @@ [Dereference an iterator. ] ] + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] + [] + ] + ] [heading Friends] @@ -79107,13 +83297,38 @@ ['Convenience header: ][^asio.hpp] - [section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator] [indexterm2 basic_resolver_iterator..ip::basic_resolver_iterator] Default constructor creates an end iterator. + ``[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload1 basic_resolver_iterator]``(); + `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload2 basic_resolver_iterator]``( + const basic_resolver_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload2 more...]]`` + + +Move constructor. + + + ``[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload3 basic_resolver_iterator]``( + basic_resolver_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator.overload3 more...]]`` + + +[section:overload1 ip::basic_resolver_iterator::basic_resolver_iterator (1 of 3 overloads)] + + +Default constructor creates an end iterator. + + basic_resolver_iterator(); @@ -79121,52 +83336,15 @@ [endsect] -[section:create ip::basic_resolver_iterator::create] -[indexterm2 create..ip::basic_resolver_iterator] -Create an iterator from an addrinfo list returned by getaddrinfo. +[section:overload2 ip::basic_resolver_iterator::basic_resolver_iterator (2 of 3 overloads)] - static basic_resolver_iterator ``[link asio.reference.ip__basic_resolver_iterator.create.overload1 create]``( - asio::detail::addrinfo_type * address_info, - const std::string & host_name, - const std::string & service_name); - `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.create.overload1 more...]]`` +Copy constructor. -Create an iterator from an endpoint, host name and service name. - - - static basic_resolver_iterator ``[link asio.reference.ip__basic_resolver_iterator.create.overload2 create]``( - const typename InternetProtocol::endpoint & endpoint, - const std::string & host_name, - const std::string & service_name); - `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.create.overload2 more...]]`` - - -Create an iterator from a sequence of endpoints, host and service name. - - - template< - typename EndpointIterator> - static basic_resolver_iterator ``[link asio.reference.ip__basic_resolver_iterator.create.overload3 create]``( - EndpointIterator begin, - EndpointIterator end, - const std::string & host_name, - const std::string & service_name); - `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.create.overload3 more...]]`` - - -[section:overload1 ip::basic_resolver_iterator::create (1 of 3 overloads)] - - -Create an iterator from an addrinfo list returned by getaddrinfo. - - - static basic_resolver_iterator create( - asio::detail::addrinfo_type * address_info, - const std::string & host_name, - const std::string & service_name); + basic_resolver_iterator( + const basic_resolver_iterator & other); @@ -79174,36 +83352,14 @@ -[section:overload2 ip::basic_resolver_iterator::create (2 of 3 overloads)] +[section:overload3 ip::basic_resolver_iterator::basic_resolver_iterator (3 of 3 overloads)] -Create an iterator from an endpoint, host name and service name. +Move constructor. - static basic_resolver_iterator create( - const typename InternetProtocol::endpoint & endpoint, - const std::string & host_name, - const std::string & service_name); - - - -[endsect] - - - -[section:overload3 ip::basic_resolver_iterator::create (3 of 3 overloads)] - - -Create an iterator from a sequence of endpoints, host and service name. - - - template< - typename EndpointIterator> - static basic_resolver_iterator create( - EndpointIterator begin, - EndpointIterator end, - const std::string & host_name, - const std::string & service_name); + basic_resolver_iterator( + basic_resolver_iterator && other); @@ -79213,6 +83369,18 @@ [endsect] +[section:dereference ip::basic_resolver_iterator::dereference] + +[indexterm2 dereference..ip::basic_resolver_iterator] + + const basic_resolver_entry< InternetProtocol > & dereference() const; + + + +[endsect] + + + [section:difference_type ip::basic_resolver_iterator::difference_type] [indexterm2 difference_type..ip::basic_resolver_iterator] @@ -79234,6 +83402,43 @@ +[section:equal ip::basic_resolver_iterator::equal] + +[indexterm2 equal..ip::basic_resolver_iterator] + + bool equal( + const basic_resolver_iterator & other) const; + + + +[endsect] + + + +[section:increment ip::basic_resolver_iterator::increment] + +[indexterm2 increment..ip::basic_resolver_iterator] + + void increment(); + + + +[endsect] + + + +[section:index_ ip::basic_resolver_iterator::index_] + +[indexterm2 index_..ip::basic_resolver_iterator] + + std::size_t index_; + + + +[endsect] + + + [section:iterator_category ip::basic_resolver_iterator::iterator_category] [indexterm2 iterator_category..ip::basic_resolver_iterator] @@ -79352,6 +83557,56 @@ [endsect] +[section:operator_eq_ ip::basic_resolver_iterator::operator=] + +[indexterm2 operator=..ip::basic_resolver_iterator] +Assignment operator. + + + basic_resolver_iterator & ``[link asio.reference.ip__basic_resolver_iterator.operator_eq_.overload1 operator=]``( + const basic_resolver_iterator & other); + `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.operator_eq_.overload1 more...]]`` + + +Move-assignment operator. + + + basic_resolver_iterator & ``[link asio.reference.ip__basic_resolver_iterator.operator_eq_.overload2 operator=]``( + basic_resolver_iterator && other); + `` [''''»''' [link asio.reference.ip__basic_resolver_iterator.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_iterator::operator= (1 of 2 overloads)] + + +Assignment operator. + + + basic_resolver_iterator & operator=( + const basic_resolver_iterator & other); + + + +[endsect] + + + +[section:overload2 ip::basic_resolver_iterator::operator= (2 of 2 overloads)] + + +Move-assignment operator. + + + basic_resolver_iterator & operator=( + basic_resolver_iterator && other); + + + +[endsect] + + +[endsect] + [section:operator_eq__eq_ ip::basic_resolver_iterator::operator==] @@ -79566,6 +83821,18 @@ +[section:values_ ip::basic_resolver_iterator::values_] + +[indexterm2 values_..ip::basic_resolver_iterator] + + values_ptr_type values_; + + + +[endsect] + + + [endsect] [section:ip__basic_resolver_query ip::basic_resolver_query] @@ -79694,7 +83961,7 @@ [section:address_configured ip::basic_resolver_query::address_configured] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 address_configured..ip::basic_resolver_query] Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. @@ -79711,7 +83978,7 @@ [section:all_matching ip::basic_resolver_query::all_matching] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 all_matching..ip::basic_resolver_query] If used with v4\_mapped, return all matching IPv6 and IPv4 addresses. @@ -79932,7 +84199,7 @@ [section:canonical_name ip::basic_resolver_query::canonical_name] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 canonical_name..ip::basic_resolver_query] Determine the canonical name of the host specified in the query. @@ -79949,7 +84216,7 @@ [section:flags ip::basic_resolver_query::flags] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 flags..ip::basic_resolver_query] A bitmask type (C++ Std [lib.bitmask.types]). @@ -80001,7 +84268,7 @@ [section:numeric_host ip::basic_resolver_query::numeric_host] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 numeric_host..ip::basic_resolver_query] Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. @@ -80018,7 +84285,7 @@ [section:numeric_service ip::basic_resolver_query::numeric_service] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 numeric_service..ip::basic_resolver_query] Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. @@ -80035,7 +84302,7 @@ [section:passive ip::basic_resolver_query::passive] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 passive..ip::basic_resolver_query] Indicate that returned endpoint is intended for use as a locally bound socket endpoint. @@ -80087,7 +84354,7 @@ [section:v4_mapped ip::basic_resolver_query::v4_mapped] -['Inherited from ip::resolver_query_base.] +['Inherited from ip::resolver_base.] [indexterm2 v4_mapped..ip::basic_resolver_query] If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. @@ -80103,6 +84370,1524 @@ [endsect] +[section:ip__basic_resolver_results ip::basic_resolver_results] + + +A range of entries produced by a resolver. + + + template< + typename ``[link asio.reference.InternetProtocol InternetProtocol]``> + class basic_resolver_results : + public ip::basic_resolver_iterator< InternetProtocol > + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_iterator [*const_iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_reference [*const_reference]]] + [The type of a const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.difference_type [*difference_type]]] + [Type used to represent the distance between two iterators in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator [*iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator_category [*iterator_category]]] + [The iterator category. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.pointer [*pointer]]] + [The type of the result of applying operator->() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.protocol_type [*protocol_type]]] + [The protocol type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.reference [*reference]]] + [The type of a non-const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.size_type [*size_type]]] + [Type used to represent a count of the elements in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.value_type [*value_type]]] + [The type of a value in the results range. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.basic_resolver_results [*basic_resolver_results]]] + [Default constructor creates an empty range. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.begin [*begin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cbegin [*cbegin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cend [*cend]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.empty [*empty]]] + [Determine whether the results range is empty. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.end [*end]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.max_size [*max_size]]] + [Get the maximum number of entries permitted in a results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator__star_ [*operator *]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_plus__plus_ [*operator++]]] + [Increment operator (prefix). + + Increment operator (postfix). ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_arrow_ [*operator->]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.size [*size]]] + [Get the number of entries in the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.swap [*swap]]] + [Swap the results range with another. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.values_ [*values_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_not__eq_ [*operator!=]]] + [Test two iterators for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq__eq_ [*operator==]]] + [Test two iterators for equality. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] class template is used to define a range over the results returned by a resolver. + +The iterator's value\_type, obtained when a results iterator is dereferenced, is: + + const basic_resolver_entry<InternetProtocol> + + + + + +[heading Remarks] + +For backward compatibility, [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] is derived from [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`]. This derivation is deprecated. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + +[section:basic_resolver_results ip::basic_resolver_results::basic_resolver_results] + +[indexterm2 basic_resolver_results..ip::basic_resolver_results] +Default constructor creates an empty range. + + + ``[link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload1 basic_resolver_results]``(); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload1 more...]]`` + + +Copy constructor. + + + ``[link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload2 basic_resolver_results]``( + const basic_resolver_results & other); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload2 more...]]`` + + +Move constructor. + + + ``[link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload3 basic_resolver_results]``( + basic_resolver_results && other); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.basic_resolver_results.overload3 more...]]`` + + +[section:overload1 ip::basic_resolver_results::basic_resolver_results (1 of 3 overloads)] + + +Default constructor creates an empty range. + + + basic_resolver_results(); + + + +[endsect] + + + +[section:overload2 ip::basic_resolver_results::basic_resolver_results (2 of 3 overloads)] + + +Copy constructor. + + + basic_resolver_results( + const basic_resolver_results & other); + + + +[endsect] + + + +[section:overload3 ip::basic_resolver_results::basic_resolver_results (3 of 3 overloads)] + + +Move constructor. + + + basic_resolver_results( + basic_resolver_results && other); + + + +[endsect] + + +[endsect] + + +[section:begin ip::basic_resolver_results::begin] + +[indexterm2 begin..ip::basic_resolver_results] +Obtain a begin iterator for the results range. + + + const_iterator begin() const; + + + +[endsect] + + + +[section:cbegin ip::basic_resolver_results::cbegin] + +[indexterm2 cbegin..ip::basic_resolver_results] +Obtain a begin iterator for the results range. + + + const_iterator cbegin() const; + + + +[endsect] + + + +[section:cend ip::basic_resolver_results::cend] + +[indexterm2 cend..ip::basic_resolver_results] +Obtain an end iterator for the results range. + + + const_iterator cend() const; + + + +[endsect] + + + +[section:const_iterator ip::basic_resolver_results::const_iterator] + +[indexterm2 const_iterator..ip::basic_resolver_results] +The type of an iterator into the range. + + + typedef basic_resolver_iterator< protocol_type > const_iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.difference_type [*difference_type]]] + [The type used for the distance between two iterators. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.iterator_category [*iterator_category]]] + [The iterator category. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.pointer [*pointer]]] + [The type of the result of applying operator->() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.reference [*reference]]] + [The type of the result of applying operator*() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.value_type [*value_type]]] + [The type of the value pointed to by the iterator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]] + [Default constructor creates an end iterator. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]] + [Increment operator (prefix). + + Increment operator (postfix). ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]] + [Test two iterators for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]] + [Test two iterators for equality. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver. + +The iterator's value\_type, obtained when the iterator is dereferenced, is: + + const basic_resolver_entry<InternetProtocol> + + + + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:const_reference ip::basic_resolver_results::const_reference] + +[indexterm2 const_reference..ip::basic_resolver_results] +The type of a const reference to a value in the range. + + + typedef const value_type & const_reference; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the endpoint entry. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]] + [The protocol type associated with the endpoint entry. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]]] + [Default constructor. + + Construct with specified endpoint, host name and service name. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]] + [Get the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.host_name [*host_name]]] + [Get the host name associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]] + [Convert to the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.service_name [*service_name]]] + [Get the service name associated with the entry. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:dereference ip::basic_resolver_results::dereference] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 dereference..ip::basic_resolver_results] + + const basic_resolver_entry< InternetProtocol > & dereference() const; + + + +[endsect] + + + +[section:difference_type ip::basic_resolver_results::difference_type] + +[indexterm2 difference_type..ip::basic_resolver_results] +Type used to represent the distance between two iterators in the range. + + + typedef std::ptrdiff_t difference_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:empty ip::basic_resolver_results::empty] + +[indexterm2 empty..ip::basic_resolver_results] +Determine whether the results range is empty. + + + bool empty() const; + + + +[endsect] + + + +[section:end ip::basic_resolver_results::end] + +[indexterm2 end..ip::basic_resolver_results] +Obtain an end iterator for the results range. + + + const_iterator end() const; + + + +[endsect] + + + +[section:endpoint_type ip::basic_resolver_results::endpoint_type] + +[indexterm2 endpoint_type..ip::basic_resolver_results] +The endpoint type associated with the results. + + + typedef protocol_type::endpoint endpoint_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:equal ip::basic_resolver_results::equal] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 equal..ip::basic_resolver_results] + + bool equal( + const basic_resolver_iterator & other) const; + + + +[endsect] + + + +[section:increment ip::basic_resolver_results::increment] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 increment..ip::basic_resolver_results] + + void increment(); + + + +[endsect] + + + +[section:index_ ip::basic_resolver_results::index_] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 index_..ip::basic_resolver_results] + + std::size_t index_; + + + +[endsect] + + + +[section:iterator ip::basic_resolver_results::iterator] + +[indexterm2 iterator..ip::basic_resolver_results] +The type of an iterator into the range. + + + typedef const_iterator iterator; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.difference_type [*difference_type]]] + [The type used for the distance between two iterators. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.iterator_category [*iterator_category]]] + [The iterator category. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.pointer [*pointer]]] + [The type of the result of applying operator->() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.reference [*reference]]] + [The type of the result of applying operator*() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_iterator.value_type [*value_type]]] + [The type of the value pointed to by the iterator. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]] + [Default constructor creates an end iterator. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]] + [Increment operator (prefix). + + Increment operator (postfix). ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]] + [Test two iterators for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]] + [Test two iterators for equality. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver. + +The iterator's value\_type, obtained when the iterator is dereferenced, is: + + const basic_resolver_entry<InternetProtocol> + + + + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:iterator_category ip::basic_resolver_results::iterator_category] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 iterator_category..ip::basic_resolver_results] +The iterator category. + + + typedef std::forward_iterator_tag iterator_category; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:max_size ip::basic_resolver_results::max_size] + +[indexterm2 max_size..ip::basic_resolver_results] +Get the maximum number of entries permitted in a results range. + + + size_type max_size() const; + + + +[endsect] + + + +[section:operator__star_ ip::basic_resolver_results::operator *] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 operator *..ip::basic_resolver_results] +Dereference an iterator. + + + const basic_resolver_entry< InternetProtocol > & operator *() const; + + + +[endsect] + + +[section:operator_not__eq_ ip::basic_resolver_results::operator!=] + +[indexterm2 operator!=..ip::basic_resolver_results] +Test two iterators for inequality. + + + friend bool ``[link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload1 operator!=]``( + const basic_resolver_results & a, + const basic_resolver_results & b); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload1 more...]]`` + + friend bool ``[link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload2 operator!=]``( + const basic_resolver_iterator & a, + const basic_resolver_iterator & b); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_not__eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_results::operator!= (1 of 2 overloads)] + + +Test two iterators for inequality. + + + friend bool operator!=( + const basic_resolver_results & a, + const basic_resolver_results & b); + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 ip::basic_resolver_results::operator!= (2 of 2 overloads)] + + +['Inherited from ip::basic_resolver.] + + +Test two iterators for inequality. + + + friend bool operator!=( + const basic_resolver_iterator & a, + const basic_resolver_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[endsect] + +[section:operator_plus__plus_ ip::basic_resolver_results::operator++] + +[indexterm2 operator++..ip::basic_resolver_results] +Increment operator (prefix). + + + basic_resolver_iterator & ``[link asio.reference.ip__basic_resolver_results.operator_plus__plus_.overload1 operator++]``(); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_plus__plus_.overload1 more...]]`` + + +Increment operator (postfix). + + + basic_resolver_iterator ``[link asio.reference.ip__basic_resolver_results.operator_plus__plus_.overload2 operator++]``( + int ); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_plus__plus_.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_results::operator++ (1 of 2 overloads)] + + +['Inherited from ip::basic_resolver.] + + +Increment operator (prefix). + + + basic_resolver_iterator & operator++(); + + + +[endsect] + + + +[section:overload2 ip::basic_resolver_results::operator++ (2 of 2 overloads)] + + +['Inherited from ip::basic_resolver.] + + +Increment operator (postfix). + + + basic_resolver_iterator operator++( + int ); + + + +[endsect] + + +[endsect] + + +[section:operator_arrow_ ip::basic_resolver_results::operator->] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 operator->..ip::basic_resolver_results] +Dereference an iterator. + + + const basic_resolver_entry< InternetProtocol > * operator->() const; + + + +[endsect] + + +[section:operator_eq_ ip::basic_resolver_results::operator=] + +[indexterm2 operator=..ip::basic_resolver_results] +Assignment operator. + + + basic_resolver_results & ``[link asio.reference.ip__basic_resolver_results.operator_eq_.overload1 operator=]``( + const basic_resolver_results & other); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq_.overload1 more...]]`` + + +Move-assignment operator. + + + basic_resolver_results & ``[link asio.reference.ip__basic_resolver_results.operator_eq_.overload2 operator=]``( + basic_resolver_results && other); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_results::operator= (1 of 2 overloads)] + + +Assignment operator. + + + basic_resolver_results & operator=( + const basic_resolver_results & other); + + + +[endsect] + + + +[section:overload2 ip::basic_resolver_results::operator= (2 of 2 overloads)] + + +Move-assignment operator. + + + basic_resolver_results & operator=( + basic_resolver_results && other); + + + +[endsect] + + +[endsect] + +[section:operator_eq__eq_ ip::basic_resolver_results::operator==] + +[indexterm2 operator==..ip::basic_resolver_results] +Test two iterators for equality. + + + friend bool ``[link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload1 operator==]``( + const basic_resolver_results & a, + const basic_resolver_results & b); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload1 more...]]`` + + friend bool ``[link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload2 operator==]``( + const basic_resolver_iterator & a, + const basic_resolver_iterator & b); + `` [''''»''' [link asio.reference.ip__basic_resolver_results.operator_eq__eq_.overload2 more...]]`` + + +[section:overload1 ip::basic_resolver_results::operator== (1 of 2 overloads)] + + +Test two iterators for equality. + + + friend bool operator==( + const basic_resolver_results & a, + const basic_resolver_results & b); + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:overload2 ip::basic_resolver_results::operator== (2 of 2 overloads)] + + +['Inherited from ip::basic_resolver.] + + +Test two iterators for equality. + + + friend bool operator==( + const basic_resolver_iterator & a, + const basic_resolver_iterator & b); + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + +[endsect] + + +[section:pointer ip::basic_resolver_results::pointer] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 pointer..ip::basic_resolver_results] +The type of the result of applying `operator->()` to the iterator. + + + typedef const basic_resolver_entry< InternetProtocol > * pointer; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:protocol_type ip::basic_resolver_results::protocol_type] + +[indexterm2 protocol_type..ip::basic_resolver_results] +The protocol type associated with the results. + + + typedef InternetProtocol protocol_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:reference ip::basic_resolver_results::reference] + +[indexterm2 reference..ip::basic_resolver_results] +The type of a non-const reference to a value in the range. + + + typedef value_type & reference; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the endpoint entry. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]] + [The protocol type associated with the endpoint entry. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]]] + [Default constructor. + + Construct with specified endpoint, host name and service name. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]] + [Get the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.host_name [*host_name]]] + [Get the host name associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]] + [Convert to the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.service_name [*service_name]]] + [Get the service name associated with the entry. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:size ip::basic_resolver_results::size] + +[indexterm2 size..ip::basic_resolver_results] +Get the number of entries in the results range. + + + size_type size() const; + + + +[endsect] + + + +[section:size_type ip::basic_resolver_results::size_type] + +[indexterm2 size_type..ip::basic_resolver_results] +Type used to represent a count of the elements in the range. + + + typedef std::size_t size_type; + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:swap ip::basic_resolver_results::swap] + +[indexterm2 swap..ip::basic_resolver_results] +Swap the results range with another. + + + void swap( + basic_resolver_results & that); + + + +[endsect] + + + +[section:value_type ip::basic_resolver_results::value_type] + +[indexterm2 value_type..ip::basic_resolver_results] +The type of a value in the results range. + + + typedef basic_resolver_entry< endpoint_type > value_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the endpoint entry. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]] + [The protocol type associated with the endpoint entry. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]]] + [Default constructor. + + Construct with specified endpoint, host name and service name. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]] + [Get the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.host_name [*host_name]]] + [Get the host name associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]] + [Convert to the endpoint associated with the entry. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_entry.service_name [*service_name]]] + [Get the service name associated with the entry. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/basic_resolver_results.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:values_ ip::basic_resolver_results::values_] + + +['Inherited from ip::basic_resolver.] + +[indexterm2 values_..ip::basic_resolver_results] + + values_ptr_type values_; + + + +[endsect] + + + +[endsect] + [section:ip__host_name ip::host_name] [indexterm1 ip::host_name] @@ -80303,7 +86088,9 @@ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint. - Copy constructor. ] + Copy constructor. + + Move constructor. ] ] [ @@ -80318,7 +86105,9 @@ [ [[link asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + + Move-assign from another endpoint. ] ] [ @@ -80517,6 +86306,13 @@ [ + [[link asio.reference.ip__basic_resolver.flags [*flags]]] + [A bitmask type (C++ Std \[lib.bitmask.types\]). ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -80525,7 +86321,7 @@ [ [[link asio.reference.ip__basic_resolver.iterator [*iterator]]] - [The iterator type. ] + [(Deprecated.) The iterator type. ] ] @@ -80539,7 +86335,14 @@ [ [[link asio.reference.ip__basic_resolver.query [*query]]] - [The query type. ] + [(Deprecated.) The query type. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver.results_type [*results_type]]] + [The results type. ] ] @@ -80558,7 +86361,9 @@ [ [[link asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]] - [Asynchronously perform forward resolution of a query to a list of entries. + [(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. + + Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. ] ] @@ -80579,13 +86384,20 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ [[link asio.reference.ip__basic_resolver.resolve [*resolve]]] - [Perform forward resolution of a query to a list of entries. + [(Deprecated.) Perform forward resolution of a query to a list of entries. + + Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. ] ] @@ -80608,6 +86420,47 @@ ] +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver.address_configured [*address_configured]]] + [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.all_matching [*all_matching]]] + [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.canonical_name [*canonical_name]]] + [Determine the canonical name of the host specified in the query. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_host [*numeric_host]]] + [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_service [*numeric_service]]] + [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.passive [*passive]]] + [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.v4_mapped [*v4_mapped]]] + [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ] + ] + +] + The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -80890,8 +86743,13 @@ ] [ + [[link asio.reference.basic_raw_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_raw_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -81126,7 +86984,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::multicast::enable_loopback option(true); socket.set_option(option); @@ -81137,7 +86995,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::multicast::enable_loopback option; socket.get_option(option); @@ -81177,7 +87035,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::multicast::hops option(4); socket.set_option(option); @@ -81188,7 +87046,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::multicast::hops option; socket.get_option(option); @@ -81228,7 +87086,7 @@ Setting the option to join a multicast group: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::address multicast_address = asio::ip::address::from_string("225.0.0.1"); @@ -81269,7 +87127,7 @@ Setting the option to leave a multicast group: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::address multicast_address = asio::ip::address::from_string("225.0.0.1"); @@ -81310,7 +87168,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::address_v4 local_interface = asio::ip::address_v4::from_string("1.2.3.4"); @@ -81509,7 +87367,7 @@ Obtain an address range corresponding to the hosts in the network. - address_range_v4 hosts() const; + address_v4_range hosts() const; @@ -82033,7 +87891,7 @@ Obtain an address range corresponding to the hosts in the network. - address_range_v6 hosts() const; + address_v6_range hosts() const; @@ -82368,13 +88226,230 @@ [endsect] +[section:ip__resolver_base ip::resolver_base] + + +The [link asio.reference.ip__resolver_base `ip::resolver_base`] class is used as a base for the [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class templates to provide a common place to define the flag constants. + + + class resolver_base + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__resolver_base.flags [*flags]]] + [A bitmask type (C++ Std \[lib.bitmask.types\]). ] + + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__resolver_base._resolver_base [*~resolver_base]]] + [Protected destructor to prevent deletion through this type. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__resolver_base.address_configured [*address_configured]]] + [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ] + ] + + [ + [[link asio.reference.ip__resolver_base.all_matching [*all_matching]]] + [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ] + ] + + [ + [[link asio.reference.ip__resolver_base.canonical_name [*canonical_name]]] + [Determine the canonical name of the host specified in the query. ] + ] + + [ + [[link asio.reference.ip__resolver_base.numeric_host [*numeric_host]]] + [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__resolver_base.numeric_service [*numeric_service]]] + [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__resolver_base.passive [*passive]]] + [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ] + ] + + [ + [[link asio.reference.ip__resolver_base.v4_mapped [*v4_mapped]]] + [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/ip/resolver_base.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:address_configured ip::resolver_base::address_configured] + +[indexterm2 address_configured..ip::resolver_base] +Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. + + + static const flags address_configured = implementation_defined; + + + +[endsect] + + + +[section:all_matching ip::resolver_base::all_matching] + +[indexterm2 all_matching..ip::resolver_base] +If used with v4\_mapped, return all matching IPv6 and IPv4 addresses. + + + static const flags all_matching = implementation_defined; + + + +[endsect] + + + +[section:canonical_name ip::resolver_base::canonical_name] + +[indexterm2 canonical_name..ip::resolver_base] +Determine the canonical name of the host specified in the query. + + + static const flags canonical_name = implementation_defined; + + + +[endsect] + + + +[section:flags ip::resolver_base::flags] + +[indexterm2 flags..ip::resolver_base] +A bitmask type (C++ Std [lib.bitmask.types]). + + + typedef unspecified flags; + + + +[heading Requirements] + +['Header: ][^asio/ip/resolver_base.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + +[section:numeric_host ip::resolver_base::numeric_host] + +[indexterm2 numeric_host..ip::resolver_base] +Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. + + + static const flags numeric_host = implementation_defined; + + + +[endsect] + + + +[section:numeric_service ip::resolver_base::numeric_service] + +[indexterm2 numeric_service..ip::resolver_base] +Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. + + + static const flags numeric_service = implementation_defined; + + + +[endsect] + + + +[section:passive ip::resolver_base::passive] + +[indexterm2 passive..ip::resolver_base] +Indicate that returned endpoint is intended for use as a locally bound socket endpoint. + + + static const flags passive = implementation_defined; + + + +[endsect] + + + +[section:v4_mapped ip::resolver_base::v4_mapped] + +[indexterm2 v4_mapped..ip::resolver_base] +If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. + + + static const flags v4_mapped = implementation_defined; + + + +[endsect] + + + +[section:_resolver_base ip::resolver_base::~resolver_base] + +[indexterm2 ~resolver_base..ip::resolver_base] +Protected destructor to prevent deletion through this type. + + + ~resolver_base(); + + + +[endsect] + + + +[endsect] + [section:ip__resolver_query_base ip::resolver_query_base] The [link asio.reference.ip__resolver_query_base `ip::resolver_query_base`] class is used as a base for the [link asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class templates to provide a common place to define the flag constants. - class resolver_query_base + class resolver_query_base : + public ip::resolver_base [heading Types] @@ -82451,6 +88526,9 @@ [section:address_configured ip::resolver_query_base::address_configured] + +['Inherited from ip::resolver_base.] + [indexterm2 address_configured..ip::resolver_query_base] Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. @@ -82465,6 +88543,9 @@ [section:all_matching ip::resolver_query_base::all_matching] + +['Inherited from ip::resolver_base.] + [indexterm2 all_matching..ip::resolver_query_base] If used with v4\_mapped, return all matching IPv6 and IPv4 addresses. @@ -82479,6 +88560,9 @@ [section:canonical_name ip::resolver_query_base::canonical_name] + +['Inherited from ip::resolver_base.] + [indexterm2 canonical_name..ip::resolver_query_base] Determine the canonical name of the host specified in the query. @@ -82493,6 +88577,9 @@ [section:flags ip::resolver_query_base::flags] + +['Inherited from ip::resolver_base.] + [indexterm2 flags..ip::resolver_query_base] A bitmask type (C++ Std [lib.bitmask.types]). @@ -82514,6 +88601,9 @@ [section:numeric_host ip::resolver_query_base::numeric_host] + +['Inherited from ip::resolver_base.] + [indexterm2 numeric_host..ip::resolver_query_base] Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. @@ -82528,6 +88618,9 @@ [section:numeric_service ip::resolver_query_base::numeric_service] + +['Inherited from ip::resolver_base.] + [indexterm2 numeric_service..ip::resolver_query_base] Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. @@ -82542,6 +88635,9 @@ [section:passive ip::resolver_query_base::passive] + +['Inherited from ip::resolver_base.] + [indexterm2 passive..ip::resolver_query_base] Indicate that returned endpoint is intended for use as a locally bound socket endpoint. @@ -82556,6 +88652,9 @@ [section:v4_mapped ip::resolver_query_base::v4_mapped] + +['Inherited from ip::resolver_base.] + [indexterm2 v4_mapped..ip::resolver_query_base] If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. @@ -82593,7 +88692,7 @@ template< typename ``[link asio.reference.InternetProtocol InternetProtocol]``> class resolver_service : - public io_service::service + public io_context::service [heading Types] @@ -82635,6 +88734,13 @@ ] + [ + + [[link asio.reference.ip__resolver_service.results_type [*results_type]]] + [The results type. ] + + ] + ] [heading Member Functions] @@ -82664,8 +88770,13 @@ ] [ + [[link asio.reference.ip__resolver_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.ip__resolver_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -82677,7 +88788,7 @@ [ [[link asio.reference.ip__resolver_service.resolver_service [*resolver_service]]] - [Construct a new resolver service for the specified io_service. ] + [Construct a new resolver service for the specified io_context. ] ] ] @@ -82832,16 +88943,33 @@ +[section:get_io_context ip::resolver_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..ip::resolver_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service ip::resolver_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..ip::resolver_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -82855,7 +88983,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -82940,16 +89068,11 @@ [ [[link asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]] - [Default constructor creates an end iterator. ] - ] - - [ - [[link asio.reference.ip__basic_resolver_iterator.create [*create]]] - [Create an iterator from an addrinfo list returned by getaddrinfo. + [Default constructor creates an end iterator. - Create an iterator from an endpoint, host name and service name. + Copy constructor. - Create an iterator from a sequence of endpoints, host and service name. ] + Move constructor. ] ] [ @@ -82969,6 +89092,50 @@ [Dereference an iterator. ] ] + [ + [[link asio.reference.ip__basic_resolver_iterator.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_iterator.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_iterator.values_ [*values_]]] + [] + ] + ] [heading Friends] @@ -83168,7 +89335,7 @@ Resolve a query to a list of entries. - iterator_type ``[link asio.reference.ip__resolver_service.resolve.overload1 resolve]``( + results_type ``[link asio.reference.ip__resolver_service.resolve.overload1 resolve]``( implementation_type & impl, const query_type & query, asio::error_code & ec); @@ -83178,7 +89345,7 @@ Resolve an endpoint to a list of entries. - iterator_type ``[link asio.reference.ip__resolver_service.resolve.overload2 resolve]``( + results_type ``[link asio.reference.ip__resolver_service.resolve.overload2 resolve]``( implementation_type & impl, const endpoint_type & endpoint, asio::error_code & ec); @@ -83191,7 +89358,7 @@ Resolve a query to a list of entries. - iterator_type resolve( + results_type resolve( implementation_type & impl, const query_type & query, asio::error_code & ec); @@ -83208,7 +89375,7 @@ Resolve an endpoint to a list of entries. - iterator_type resolve( + results_type resolve( implementation_type & impl, const endpoint_type & endpoint, asio::error_code & ec); @@ -83224,11 +89391,11 @@ [section:resolver_service ip::resolver_service::resolver_service] [indexterm2 resolver_service..ip::resolver_service] -Construct a new resolver service for the specified [link asio.reference.io_service `io_service`]. +Construct a new resolver service for the specified [link asio.reference.io_context `io_context`]. resolver_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -83236,6 +89403,265 @@ +[section:results_type ip::resolver_service::results_type] + +[indexterm2 results_type..ip::resolver_service] +The results type. + + + typedef basic_resolver_results< InternetProtocol > results_type; + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_iterator [*const_iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.const_reference [*const_reference]]] + [The type of a const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.difference_type [*difference_type]]] + [Type used to represent the distance between two iterators in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.endpoint_type [*endpoint_type]]] + [The endpoint type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator [*iterator]]] + [The type of an iterator into the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.iterator_category [*iterator_category]]] + [The iterator category. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.pointer [*pointer]]] + [The type of the result of applying operator->() to the iterator. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.protocol_type [*protocol_type]]] + [The protocol type associated with the results. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.reference [*reference]]] + [The type of a non-const reference to a value in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.size_type [*size_type]]] + [Type used to represent a count of the elements in the range. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver_results.value_type [*value_type]]] + [The type of a value in the results range. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.basic_resolver_results [*basic_resolver_results]]] + [Default constructor creates an empty range. + + Copy constructor. + + Move constructor. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.begin [*begin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cbegin [*cbegin]]] + [Obtain a begin iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.cend [*cend]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.empty [*empty]]] + [Determine whether the results range is empty. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.end [*end]]] + [Obtain an end iterator for the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.max_size [*max_size]]] + [Get the maximum number of entries permitted in a results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator__star_ [*operator *]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_plus__plus_ [*operator++]]] + [Increment operator (prefix). + + Increment operator (postfix). ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_arrow_ [*operator->]]] + [Dereference an iterator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq_ [*operator=]]] + [Assignment operator. + + Move-assignment operator. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.size [*size]]] + [Get the number of entries in the results range. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.swap [*swap]]] + [Swap the results range with another. ] + ] + +] + +[heading Protected Member Functions] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.dereference [*dereference]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.equal [*equal]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.increment [*increment]]] + [] + ] + +] + +[heading Protected Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.index_ [*index_]]] + [] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.values_ [*values_]]] + [] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_not__eq_ [*operator!=]]] + [Test two iterators for inequality. ] + ] + + [ + [[link asio.reference.ip__basic_resolver_results.operator_eq__eq_ [*operator==]]] + [Test two iterators for equality. ] + ] + +] + +The [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] class template is used to define a range over the results returned by a resolver. + +The iterator's value\_type, obtained when a results iterator is dereferenced, is: + + const basic_resolver_entry<InternetProtocol> + + + + + +[heading Remarks] + +For backward compatibility, [link asio.reference.ip__basic_resolver_results `ip::basic_resolver_results`] is derived from [link asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`]. This derivation is deprecated. + + +[heading Thread Safety] + +['Distinct] ['objects:] Safe. + +['Shared] ['objects:] Unsafe. + + + + +[heading Requirements] + +['Header: ][^asio/ip/resolver_service.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [endsect] [section:ip__tcp ip::tcp] @@ -83585,8 +90011,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -83718,7 +90149,7 @@ Opening a socket acceptor with the SO\_REUSEADDR option enabled: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); @@ -83790,7 +90221,9 @@ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint. - Copy constructor. ] + Copy constructor. + + Move constructor. ] ] [ @@ -83805,7 +90238,9 @@ [ [[link asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + + Move-assign from another endpoint. ] ] [ @@ -84053,7 +90488,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option(true); socket.set_option(option); @@ -84064,7 +90499,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::tcp::no_delay option; socket.get_option(option); @@ -84174,6 +90609,13 @@ [ + [[link asio.reference.ip__basic_resolver.flags [*flags]]] + [A bitmask type (C++ Std \[lib.bitmask.types\]). ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -84182,7 +90624,7 @@ [ [[link asio.reference.ip__basic_resolver.iterator [*iterator]]] - [The iterator type. ] + [(Deprecated.) The iterator type. ] ] @@ -84196,7 +90638,14 @@ [ [[link asio.reference.ip__basic_resolver.query [*query]]] - [The query type. ] + [(Deprecated.) The query type. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver.results_type [*results_type]]] + [The results type. ] ] @@ -84215,7 +90664,9 @@ [ [[link asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]] - [Asynchronously perform forward resolution of a query to a list of entries. + [(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. + + Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. ] ] @@ -84236,13 +90687,20 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ [[link asio.reference.ip__basic_resolver.resolve [*resolve]]] - [Perform forward resolution of a query to a list of entries. + [(Deprecated.) Perform forward resolution of a query to a list of entries. + + Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. ] ] @@ -84265,6 +90723,47 @@ ] +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver.address_configured [*address_configured]]] + [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.all_matching [*all_matching]]] + [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.canonical_name [*canonical_name]]] + [Determine the canonical name of the host specified in the query. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_host [*numeric_host]]] + [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_service [*numeric_service]]] + [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.passive [*passive]]] + [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.v4_mapped [*v4_mapped]]] + [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ] + ] + +] + The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -84547,8 +91046,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -84918,7 +91422,9 @@ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint. - Copy constructor. ] + Copy constructor. + + Move constructor. ] ] [ @@ -84933,7 +91439,9 @@ [ [[link asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]] - [Assign from another endpoint. ] + [Assign from another endpoint. + + Move-assign from another endpoint. ] ] [ @@ -85132,6 +91640,13 @@ [ + [[link asio.reference.ip__basic_resolver.flags [*flags]]] + [A bitmask type (C++ Std \[lib.bitmask.types\]). ] + + ] + + [ + [[link asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]] [The underlying implementation type of I/O object. ] @@ -85140,7 +91655,7 @@ [ [[link asio.reference.ip__basic_resolver.iterator [*iterator]]] - [The iterator type. ] + [(Deprecated.) The iterator type. ] ] @@ -85154,7 +91669,14 @@ [ [[link asio.reference.ip__basic_resolver.query [*query]]] - [The query type. ] + [(Deprecated.) The query type. ] + + ] + + [ + + [[link asio.reference.ip__basic_resolver.results_type [*results_type]]] + [The results type. ] ] @@ -85173,7 +91695,9 @@ [ [[link asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]] - [Asynchronously perform forward resolution of a query to a list of entries. + [(Deprecated.) Asynchronously perform forward resolution of a query to a list of entries. + + Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. ] ] @@ -85194,13 +91718,20 @@ ] [ + [[link asio.reference.ip__basic_resolver.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ [[link asio.reference.ip__basic_resolver.resolve [*resolve]]] - [Perform forward resolution of a query to a list of entries. + [(Deprecated.) Perform forward resolution of a query to a list of entries. + + Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. ] ] @@ -85223,6 +91754,47 @@ ] +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.ip__basic_resolver.address_configured [*address_configured]]] + [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.all_matching [*all_matching]]] + [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.canonical_name [*canonical_name]]] + [Determine the canonical name of the host specified in the query. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_host [*numeric_host]]] + [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.numeric_service [*numeric_service]]] + [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.passive [*passive]]] + [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ] + ] + + [ + [[link asio.reference.ip__basic_resolver.v4_mapped [*v4_mapped]]] + [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ] + ] + +] + The [link asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints. @@ -85505,8 +92077,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -85741,7 +92318,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::unicast::hops option(4); socket.set_option(option); @@ -85752,7 +92329,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::ip::unicast::hops option; socket.get_option(option); @@ -85824,7 +92401,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::v6_only option(true); socket.set_option(option); @@ -85835,7 +92412,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::ip::v6_only option; socket.get_option(option); @@ -85897,6 +92474,51 @@ [endsect] +[section:is_endpoint_sequence is_endpoint_sequence] + + +Type trait used to determine whether a type is an endpoint sequence that can be used with with `connect` and `async_connect`. + + + template< + typename T> + struct is_endpoint_sequence + + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link asio.reference.is_endpoint_sequence.value [*value]]] + [The value member is true if the type may be used as an endpoint sequence. ] + ] + +] + +[heading Requirements] + +['Header: ][^asio/connect.hpp] + +['Convenience header: ][^asio.hpp] + + +[section:value is_endpoint_sequence::value] + +[indexterm2 value..is_endpoint_sequence] +The value member is true if the type may be used as an endpoint sequence. + + + static const bool value; + + + +[endsect] + + + +[endsect] + [section:is_executor is_executor] @@ -87289,8 +93911,13 @@ ] [ + [[link asio.reference.basic_datagram_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -87786,8 +94413,13 @@ ] [ + [[link asio.reference.basic_socket_acceptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -87919,7 +94551,7 @@ Opening a socket acceptor with the SO\_REUSEADDR option enabled: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); asio::ip::tcp::endpoint endpoint(asio::ip::tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(asio::ip::tcp::acceptor::reuse_address(true)); @@ -88501,8 +95133,13 @@ ] [ + [[link asio.reference.basic_stream_socket.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_stream_socket.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -88694,67 +95331,67 @@ [endsect] -[section:make_work make_work] +[section:make_work_guard make_work_guard] -[indexterm1 make_work] -Create an [link asio.reference.executor_work `executor_work`] object. +[indexterm1 make_work_guard] +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename ``[link asio.reference.Executor1 Executor]``> - executor_work< Executor > ``[link asio.reference.make_work.overload1 make_work]``( + executor_work_guard< Executor > ``[link asio.reference.make_work_guard.overload1 make_work_guard]``( const Executor & ex, typename enable_if< is_executor< Executor >::value >::type * = 0); - `` [''''»''' [link asio.reference.make_work.overload1 more...]]`` + `` [''''»''' [link asio.reference.make_work_guard.overload1 more...]]`` template< typename ExecutionContext> - executor_work< typename ExecutionContext::executor_type > ``[link asio.reference.make_work.overload2 make_work]``( + executor_work_guard< typename ExecutionContext::executor_type > ``[link asio.reference.make_work_guard.overload2 make_work_guard]``( ExecutionContext & ctx, typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); - `` [''''»''' [link asio.reference.make_work.overload2 more...]]`` + `` [''''»''' [link asio.reference.make_work_guard.overload2 more...]]`` template< typename T> - executor_work< typename associated_executor< T >::type > ``[link asio.reference.make_work.overload3 make_work]``( + executor_work_guard< typename associated_executor< T >::type > ``[link asio.reference.make_work_guard.overload3 make_work_guard]``( 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...]]`` + `` [''''»''' [link asio.reference.make_work_guard.overload3 more...]]`` template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - executor_work< typename associated_executor< T, Executor >::type > ``[link asio.reference.make_work.overload4 make_work]``( + executor_work_guard< typename associated_executor< T, Executor >::type > ``[link asio.reference.make_work_guard.overload4 make_work_guard]``( const T & t, const Executor & ex, typename enable_if< is_executor< Executor >::value >::type * = 0); - `` [''''»''' [link asio.reference.make_work.overload4 more...]]`` + `` [''''»''' [link asio.reference.make_work_guard.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]``( + executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > ``[link asio.reference.make_work_guard.overload5 make_work_guard]``( const T & t, ExecutionContext & ctx, typename enable_if<!is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type * = 0); - `` [''''»''' [link asio.reference.make_work.overload5 more...]]`` + `` [''''»''' [link asio.reference.make_work_guard.overload5 more...]]`` [heading Requirements] -['Header: ][^asio/executor_work.hpp] +['Header: ][^asio/executor_work_guard.hpp] ['Convenience header: ][^asio.hpp] -[section:overload1 make_work (1 of 5 overloads)] +[section:overload1 make_work_guard (1 of 5 overloads)] -Create an [link asio.reference.executor_work `executor_work`] object. +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename ``[link asio.reference.Executor1 Executor]``> - executor_work< Executor > make_work( + executor_work_guard< Executor > make_work_guard( const Executor & ex, typename enable_if< is_executor< Executor >::value >::type * = 0); @@ -88764,15 +95401,15 @@ -[section:overload2 make_work (2 of 5 overloads)] +[section:overload2 make_work_guard (2 of 5 overloads)] -Create an [link asio.reference.executor_work `executor_work`] object. +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename ExecutionContext> - executor_work< typename ExecutionContext::executor_type > make_work( + executor_work_guard< typename ExecutionContext::executor_type > make_work_guard( ExecutionContext & ctx, typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); @@ -88782,15 +95419,15 @@ -[section:overload3 make_work (3 of 5 overloads)] +[section:overload3 make_work_guard (3 of 5 overloads)] -Create an [link asio.reference.executor_work `executor_work`] object. +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename T> - executor_work< typename associated_executor< T >::type > make_work( + executor_work_guard< typename associated_executor< T >::type > make_work_guard( const T & t, typename enable_if<!is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type * = 0); @@ -88800,16 +95437,16 @@ -[section:overload4 make_work (4 of 5 overloads)] +[section:overload4 make_work_guard (4 of 5 overloads)] -Create an [link asio.reference.executor_work `executor_work`] object. +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename T, typename ``[link asio.reference.Executor1 Executor]``> - executor_work< typename associated_executor< T, Executor >::type > make_work( + executor_work_guard< typename associated_executor< T, Executor >::type > make_work_guard( const T & t, const Executor & ex, typename enable_if< is_executor< Executor >::value >::type * = 0); @@ -88820,16 +95457,16 @@ -[section:overload5 make_work (5 of 5 overloads)] +[section:overload5 make_work_guard (5 of 5 overloads)] -Create an [link asio.reference.executor_work `executor_work`] object. +Create an [link asio.reference.executor_work_guard `executor_work_guard`] object. template< typename T, typename ExecutionContext> - executor_work< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work( + executor_work_guard< typename associated_executor< T, typename ExecutionContext::executor_type >::type > make_work_guard( const T & t, ExecutionContext & ctx, typename enable_if<!is_executor< T >::value &&!is_convertible< T &, execution_context & >::value >::type * = 0); @@ -89896,6 +96533,26 @@ +[section:placeholders__endpoint placeholders::endpoint] + +[indexterm1 placeholders::endpoint] +An argument placeholder, for use with boost::bind(), that corresponds to the results argument of a handler for asynchronous functions such as `asio::async_connect`. + + + unspecified endpoint; + + +[heading Requirements] + +['Header: ][^asio/placeholders.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:placeholders__error placeholders::error] [indexterm1 placeholders::error] @@ -89919,7 +96576,7 @@ [section:placeholders__iterator placeholders::iterator] [indexterm1 placeholders::iterator] -An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as asio::basic\_resolver::async\_resolve. +An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as `asio::async_connect`. unspecified iterator; @@ -89936,6 +96593,26 @@ +[section:placeholders__results placeholders::results] + +[indexterm1 placeholders::results] +An argument placeholder, for use with boost::bind(), that corresponds to the results argument of a handler for asynchronous functions such as asio::basic\_resolver::async\_resolve. + + + unspecified results; + + +[heading Requirements] + +['Header: ][^asio/placeholders.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + + [section:placeholders__signal_number placeholders::signal_number] [indexterm1 placeholders::signal_number] @@ -90062,8 +96739,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -90235,7 +96917,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -90254,7 +96936,7 @@ ... - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... descriptor.async_wait( asio::posix::stream_descriptor::wait_read, @@ -90276,7 +96958,7 @@ explicit ``[link asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.posix__basic_descriptor.basic_descriptor.overload1 more...]]`` @@ -90284,7 +96966,7 @@ ``[link asio.reference.posix__basic_descriptor.basic_descriptor.overload2 basic_descriptor]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_descriptor); `` [''''»''' [link asio.reference.posix__basic_descriptor.basic_descriptor.overload2 more...]]`` @@ -90304,7 +96986,7 @@ basic_descriptor( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a descriptor without opening it. @@ -90315,7 +96997,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]] ] @@ -90333,7 +97015,7 @@ basic_descriptor( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_descriptor); @@ -90345,7 +97027,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]] [[native_descriptor][A native descriptor.]] @@ -90393,7 +97075,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_descriptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_descriptor(io_context&) constructor`. @@ -90424,7 +97106,7 @@ - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::descriptor_base::bytes_readable command(true); descriptor.io_control(command); @@ -90600,7 +97282,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -90608,38 +97290,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -90649,12 +97331,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -90737,24 +97419,50 @@ [endsect] +[section:get_io_context posix::basic_descriptor::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..posix::basic_descriptor] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service posix::basic_descriptor::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..posix::basic_descriptor] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -90894,7 +97602,7 @@ Getting the number of bytes ready to read: - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::posix::stream_descriptor::bytes_readable command; descriptor.io_control(command); @@ -90943,7 +97651,7 @@ Getting the number of bytes ready to read: - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::posix::stream_descriptor::bytes_readable command; asio::error_code ec; @@ -91147,8 +97855,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -91560,7 +98273,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_descriptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_descriptor(io_context&) constructor`. @@ -91653,7 +98366,7 @@ Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... descriptor.wait(asio::posix::stream_descriptor::wait_read); @@ -91697,7 +98410,7 @@ Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::error_code ec; descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); @@ -91889,8 +98602,13 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -92076,7 +98794,7 @@ std::size_t bytes_transferred // Number of bytes read. ); `` -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()`.]] +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_context::post()`.]] ] @@ -92134,7 +98852,7 @@ 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()`.]] +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_context::post()`.]] ] @@ -92153,7 +98871,7 @@ ... - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... descriptor.async_wait( asio::posix::stream_descriptor::wait_read, @@ -92200,7 +98918,7 @@ std::size_t bytes_transferred // Number of bytes written. ); `` -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()`.]] +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_context::post()`.]] ] @@ -92232,7 +98950,7 @@ explicit ``[link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 basic_stream_descriptor]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 more...]]`` @@ -92240,7 +98958,7 @@ ``[link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 basic_stream_descriptor]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_descriptor); `` [''''»''' [link asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 more...]]`` @@ -92260,7 +98978,7 @@ basic_stream_descriptor( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a stream descriptor without opening it. The descriptor needs to be opened and then connected or accepted before data can be sent or received on it. @@ -92271,7 +98989,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]] ] @@ -92289,7 +99007,7 @@ basic_stream_descriptor( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_descriptor); @@ -92301,7 +99019,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]] [[native_descriptor][The new underlying descriptor implementation.]] @@ -92349,7 +99067,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_descriptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_descriptor(io_context&) constructor`. @@ -92380,7 +99098,7 @@ - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::descriptor_base::bytes_readable command(true); descriptor.io_control(command); @@ -92568,7 +99286,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -92576,38 +99294,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -92617,12 +99335,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -92705,24 +99423,50 @@ [endsect] +[section:get_io_context posix::basic_stream_descriptor::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..posix::basic_stream_descriptor] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service posix::basic_stream_descriptor::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..posix::basic_stream_descriptor] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -92861,7 +99605,7 @@ Getting the number of bytes ready to read: - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::posix::stream_descriptor::bytes_readable command; descriptor.io_control(command); @@ -92913,7 +99657,7 @@ Getting the number of bytes ready to read: - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::posix::stream_descriptor::bytes_readable command; asio::error_code ec; @@ -93129,8 +99873,13 @@ ] [ + [[link asio.reference.posix__basic_descriptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -93563,7 +100312,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_descriptor(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_descriptor(io_context&) constructor`. @@ -93788,7 +100537,7 @@ Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... descriptor.wait(asio::posix::stream_descriptor::wait_read); @@ -93835,7 +100584,7 @@ Waiting for a descriptor to become readable. - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::error_code ec; descriptor.wait(asio::posix::stream_descriptor::wait_read, ec); @@ -94087,7 +100836,7 @@ - asio::posix::stream_descriptor descriptor(io_service); + asio::posix::stream_descriptor descriptor(io_context); ... asio::descriptor_base::bytes_readable command(true); descriptor.io_control(command); @@ -94280,8 +101029,13 @@ ] [ + [[link asio.reference.posix__basic_stream_descriptor.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -94393,7 +101147,7 @@ class stream_descriptor_service : - public io_service::service + public io_context::service [heading Types] @@ -94461,8 +101215,13 @@ ] [ + [[link asio.reference.posix__stream_descriptor_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.posix__stream_descriptor_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -94516,7 +101275,7 @@ [ [[link asio.reference.posix__stream_descriptor_service.stream_descriptor_service [*stream_descriptor_service]]] - [Construct a new stream descriptor service for the specified io_service. ] + [Construct a new stream descriptor service for the specified io_context. ] ] [ @@ -94687,16 +101446,33 @@ +[section:get_io_context posix::stream_descriptor_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..posix::stream_descriptor_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service posix::stream_descriptor_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..posix::stream_descriptor_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -94710,7 +101486,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -94987,11 +101763,11 @@ [section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service] [indexterm2 stream_descriptor_service..posix::stream_descriptor_service] -Construct a new stream descriptor service for the specified [link asio.reference.io_service `io_service`]. +Construct a new stream descriptor service for the specified [link asio.reference.io_context `io_context`]. stream_descriptor_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -95202,7 +101978,7 @@ template< typename ``[link asio.reference.Protocol Protocol]``> class raw_socket_service : - public io_service::service + public io_context::service [heading Types] @@ -95324,8 +102100,13 @@ ] [ + [[link asio.reference.raw_socket_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.raw_socket_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -95384,7 +102165,7 @@ [ [[link asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]] - [Construct a new raw socket service for the specified io_service. ] + [Construct a new raw socket service for the specified io_context. ] ] [ @@ -95755,16 +102536,33 @@ +[section:get_io_context raw_socket_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..raw_socket_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service raw_socket_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..raw_socket_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -95797,7 +102595,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -96092,11 +102890,11 @@ [section:raw_socket_service raw_socket_service::raw_socket_service] [indexterm2 raw_socket_service..raw_socket_service] -Construct a new raw socket service for the specified [link asio.reference.io_service `io_service`]. +Construct a new raw socket service for the specified [link asio.reference.io_context `io_context`]. raw_socket_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -99489,7 +106287,7 @@ template< typename ``[link asio.reference.Protocol Protocol]``> class seq_packet_socket_service : - public io_service::service + public io_context::service [heading Types] @@ -99601,8 +106399,13 @@ ] [ + [[link asio.reference.seq_packet_socket_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.seq_packet_socket_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -99676,7 +106479,7 @@ [ [[link asio.reference.seq_packet_socket_service.seq_packet_socket_service [*seq_packet_socket_service]]] - [Construct a new sequenced packet socket service for the specified io_service. ] + [Construct a new sequenced packet socket service for the specified io_context. ] ] [ @@ -99981,16 +106784,33 @@ +[section:get_io_context seq_packet_socket_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..seq_packet_socket_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service seq_packet_socket_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..seq_packet_socket_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -100023,7 +106843,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -100377,11 +107197,11 @@ [section:seq_packet_socket_service seq_packet_socket_service::seq_packet_socket_service] [indexterm2 seq_packet_socket_service..seq_packet_socket_service] -Construct a new sequenced packet socket service for the specified [link asio.reference.io_service `io_service`]. +Construct a new sequenced packet socket service for the specified [link asio.reference.io_context `io_context`]. seq_packet_socket_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -100541,8 +107361,13 @@ ] [ + [[link asio.reference.basic_serial_port.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_serial_port.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -101370,7 +108195,7 @@ class serial_port_service : - public io_service::service + public io_context::service [heading Types] @@ -101433,8 +108258,13 @@ ] [ + [[link asio.reference.serial_port_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.serial_port_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -101479,7 +108309,7 @@ [ [[link asio.reference.serial_port_service.serial_port_service [*serial_port_service]]] - [Construct a new serial port service for the specified io_service. ] + [Construct a new serial port service for the specified io_context. ] ] [ @@ -101631,16 +108461,33 @@ +[section:get_io_context serial_port_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..serial_port_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service serial_port_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..serial_port_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -101673,7 +108520,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -101841,11 +108688,11 @@ [section:serial_port_service serial_port_service::serial_port_service] [indexterm2 serial_port_service..serial_port_service] -Construct a new serial port service for the specified [link asio.reference.io_service `io_service`]. +Construct a new serial port service for the specified [link asio.reference.io_context `io_context`]. serial_port_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -102012,8 +108859,13 @@ ] [ + [[link asio.reference.basic_signal_set.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_signal_set.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -102068,7 +108920,7 @@ ... // Construct a signal set registered for process termination. - asio::signal_set signals(io_service, SIGINT, SIGTERM); + asio::signal_set signals(io_context, SIGINT, SIGTERM); // Start an asynchronous wait for one of the signals to occur. signals.async_wait(handler); @@ -102119,7 +108971,7 @@ class signal_set_service : - public io_service::service + public io_context::service [heading Types] @@ -102170,8 +109022,13 @@ ] [ + [[link asio.reference.signal_set_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.signal_set_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -102181,7 +109038,7 @@ [ [[link asio.reference.signal_set_service.signal_set_service [*signal_set_service]]] - [Construct a new signal set service for the specified io_service. ] + [Construct a new signal set service for the specified io_context. ] ] ] @@ -102299,16 +109156,33 @@ +[section:get_io_context signal_set_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..signal_set_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service signal_set_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..signal_set_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -102322,7 +109196,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -102371,11 +109245,11 @@ [section:signal_set_service signal_set_service::signal_set_service] [indexterm2 signal_set_service..signal_set_service] -Construct a new signal set service for the specified [link asio.reference.io_service `io_service`]. +Construct a new signal set service for the specified [link asio.reference.io_context `io_context`]. signal_set_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -102394,7 +109268,7 @@ template< typename ``[link asio.reference.Protocol Protocol]``> class socket_acceptor_service : - public io_service::service + public io_context::service [heading Types] @@ -102486,8 +109360,13 @@ ] [ + [[link asio.reference.socket_acceptor_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.socket_acceptor_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -102556,7 +109435,7 @@ [ [[link asio.reference.socket_acceptor_service.socket_acceptor_service [*socket_acceptor_service]]] - [Construct a new socket acceptor service for the specified io_service. ] + [Construct a new socket acceptor service for the specified io_context. ] ] [ @@ -102785,16 +109664,33 @@ +[section:get_io_context socket_acceptor_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..socket_acceptor_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service socket_acceptor_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..socket_acceptor_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -102827,7 +109723,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -103160,11 +110056,11 @@ [section:socket_acceptor_service socket_acceptor_service::socket_acceptor_service] [indexterm2 socket_acceptor_service..socket_acceptor_service] -Construct a new socket acceptor service for the specified [link asio.reference.io_service `io_service`]. +Construct a new socket acceptor service for the specified [link asio.reference.io_context `io_context`]. socket_acceptor_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -103377,7 +110273,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option(true); socket.set_option(option); @@ -103388,7 +110284,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::broadcast option; socket.get_option(option); @@ -103428,7 +110324,7 @@ - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::bytes_readable command(true); socket.io_control(command); @@ -103468,7 +110364,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option(true); socket.set_option(option); @@ -103479,7 +110375,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::debug option; socket.get_option(option); @@ -103519,7 +110415,7 @@ Setting the option: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option(true); socket.set_option(option); @@ -103530,7 +110426,7 @@ Getting the current option value: - asio::ip::udp::socket socket(io_service); + asio::ip::udp::socket socket(io_context); ... asio::socket_base::do_not_route option; socket.get_option(option); @@ -103570,7 +110466,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option(true); acceptor.set_option(option); @@ -103581,7 +110477,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::enable_connection_aborted option; acceptor.get_option(option); @@ -103621,7 +110517,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option(true); socket.set_option(option); @@ -103632,7 +110528,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::keep_alive option; socket.get_option(option); @@ -103672,7 +110568,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option(true, 30); socket.set_option(option); @@ -103683,7 +110579,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::linger option; socket.get_option(option); @@ -103815,7 +110711,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option(8192); socket.set_option(option); @@ -103826,7 +110722,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_buffer_size option; socket.get_option(option); @@ -103866,7 +110762,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option(1024); socket.set_option(option); @@ -103877,7 +110773,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::receive_low_watermark option; socket.get_option(option); @@ -103917,7 +110813,7 @@ Setting the option: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option(true); acceptor.set_option(option); @@ -103928,7 +110824,7 @@ Getting the current option value: - asio::ip::tcp::acceptor acceptor(io_service); + asio::ip::tcp::acceptor acceptor(io_context); ... asio::socket_base::reuse_address option; acceptor.get_option(option); @@ -103968,7 +110864,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option(8192); socket.set_option(option); @@ -103979,7 +110875,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_buffer_size option; socket.get_option(option); @@ -104019,7 +110915,7 @@ Setting the option: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option(1024); socket.set_option(option); @@ -104030,7 +110926,7 @@ Getting the current option value: - asio::ip::tcp::socket socket(io_service); + asio::ip::tcp::socket socket(io_context); ... asio::socket_base::send_low_watermark option; socket.get_option(option); @@ -104201,7 +111097,7 @@ template< typename Function> void ``[link asio.reference.spawn.overload6 spawn]``( - const asio::io_service::strand & s, + const asio::io_context::strand & s, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); `` [''''»''' [link asio.reference.spawn.overload6 more...]]`` @@ -104476,7 +111372,7 @@ template< typename Function> void spawn( - const asio::io_service::strand & s, + const asio::io_context::strand & s, Function && function, const boost::coroutines::attributes & attributes = boost::coroutines::attributes()); @@ -107810,9 +114706,9 @@ ctx.set_default_verify_paths(); // Open a socket and connect it to the remote host. - asio::io_service io_service; - ssl_socket sock(io_service, ctx); - tcp::resolver resolver(io_service); + asio::io_context io_context; + ssl_socket sock(io_context, ctx); + tcp::resolver resolver(io_context); tcp::resolver::query query("host.name", "https"); asio::connect(sock.lowest_layer(), resolver.resolve(query)); sock.lowest_layer().set_option(tcp::no_delay(true)); @@ -107969,8 +114865,8 @@ ] [ - [[link asio.reference.ssl__stream.get_io_service [*get_io_service]]] - [Get the io_service associated with the object. ] + [[link asio.reference.ssl__stream.get_io_context [*get_io_context]]] + [Get the io_context associated with the object. ] ] [ @@ -108049,9 +114945,9 @@ To use the SSL stream template with an `ip::tcp::socket`, you would write: - asio::io_service io_service; + asio::io_context io_context; asio::ssl::context ctx(asio::ssl::context::sslv23); - asio::ssl::stream<asio:ip::tcp::socket> sock(io_service, ctx); + asio::ssl::stream<asio:ip::tcp::socket> sock(io_context, ctx); @@ -108306,21 +115202,21 @@ -[section:get_io_service ssl::stream::get_io_service] +[section:get_io_context ssl::stream::get_io_context] -[indexterm2 get_io_service..ssl::stream] -Get the [link asio.reference.io_service `io_service`] associated with the object. +[indexterm2 get_io_context..ssl::stream] +Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_context(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the stream uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the stream uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that stream will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that stream will use to dispatch handlers. Ownership is not transferred to the caller. @@ -108642,7 +115538,7 @@ The `native_handle()` function returns a pointer of type `SSL*` that is suitable for passing to functions such as `SSL_get_verify_result` and `SSL_get_peer_certificate:` - asio::ssl::stream<asio:ip::tcp::socket> sock(io_service, ctx); + asio::ssl::stream<asio:ip::tcp::socket> sock(io_context, ctx); // ... establish connection and perform handshake ... @@ -109911,8 +116807,13 @@ ] [ + [[link asio.reference.basic_waitable_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -109967,7 +116868,7 @@ Performing a blocking wait (C++11): // Construct a timer without setting an expiry time. - asio::steady_timer timer(io_service); + asio::steady_timer timer(io_context); // Set an expiry time relative to now. timer.expires_after(std::chrono::seconds(5)); @@ -109992,7 +116893,7 @@ ... // Construct a timer with an absolute expiry time. - asio::steady_timer timer(io_service, + asio::steady_timer timer(io_context, std::chrono::steady_clock::now() + std::chrono::seconds(60)); // Start an asynchronous wait. @@ -110738,7 +117639,7 @@ template< typename ``[link asio.reference.Protocol Protocol]``> class stream_socket_service : - public io_service::service + public io_context::service [heading Types] @@ -110850,8 +117751,13 @@ ] [ + [[link asio.reference.stream_socket_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.stream_socket_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -110935,7 +117841,7 @@ [ [[link asio.reference.stream_socket_service.stream_socket_service [*stream_socket_service]]] - [Construct a new stream socket service for the specified io_service. ] + [Construct a new stream socket service for the specified io_context. ] ] [ @@ -111229,16 +118135,33 @@ +[section:get_io_context stream_socket_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..stream_socket_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service stream_socket_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..stream_socket_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -111271,7 +118194,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -111660,11 +118583,11 @@ [section:stream_socket_service stream_socket_service::stream_socket_service] [indexterm2 stream_socket_service..stream_socket_service] -Construct a new stream socket service for the specified [link asio.reference.io_service `io_service`]. +Construct a new stream socket service for the specified [link asio.reference.io_context `io_context`]. stream_socket_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -112832,7 +119755,7 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & ``[link asio.reference.system_executor__context_impl.use_service.overload2 use_service]``( - io_service & ios); + io_context & ioc); `` [''''»''' [link asio.reference.system_executor__context_impl.use_service.overload2 more...]]`` @@ -112893,10 +119816,10 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & use_service( - io_service & ios); + io_context & ioc); -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. +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_context `io_context`] will create a new instance of the service. [heading Parameters] @@ -112904,7 +119827,7 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] ] @@ -112916,7 +119839,7 @@ [heading Remarks] -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. @@ -113134,8 +120057,13 @@ ] [ + [[link asio.reference.basic_waitable_timer.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.basic_waitable_timer.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -113190,7 +120118,7 @@ Performing a blocking wait (C++11): // Construct a timer without setting an expiry time. - asio::steady_timer timer(io_service); + asio::steady_timer timer(io_context); // Set an expiry time relative to now. timer.expires_after(std::chrono::seconds(5)); @@ -113215,7 +120143,7 @@ ... // Construct a timer with an absolute expiry time. - asio::steady_timer timer(io_service, + asio::steady_timer timer(io_context, std::chrono::steady_clock::now() + std::chrono::seconds(60)); // Start an asynchronous wait. @@ -113326,14 +120254,14 @@ [heading Example] -A typical use of [link asio.reference.thread `thread`] would be to launch a thread to run an io\_service's event processing loop: +A typical use of [link asio.reference.thread `thread`] would be to launch a thread to run an io\_context's event processing loop: - asio::io_service io_service; + asio::io_context io_context; // ... - asio::thread t(boost::bind(&asio::io_service::run, &io_service)); + asio::thread t(boost::bind(&asio::io_context::run, &io_context)); // ... t.join(); @@ -113968,7 +120896,7 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & ``[link asio.reference.thread_pool.use_service.overload2 use_service]``( - io_service & ios); + io_context & ioc); `` [''''»''' [link asio.reference.thread_pool.use_service.overload2 more...]]`` @@ -114029,10 +120957,10 @@ template< typename ``[link asio.reference.Service Service]``> friend Service & use_service( - io_service & ios); + io_context & ioc); -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. +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_context `io_context`] will create a new instance of the service. [heading Parameters] @@ -114040,7 +120968,7 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] ] @@ -114052,7 +120980,7 @@ [heading Remarks] -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. @@ -114844,6 +121772,11 @@ [ [[link asio.reference.use_future_t.operator_lb__rb_ [*operator\[\]]]] + [(Deprecated: Use rebind().) Specify an alternate allocator. ] + ] + + [ + [[link asio.reference.use_future_t.rebind [*rebind]]] [Specify an alternate allocator. ] ] @@ -114913,7 +121846,7 @@ [section:operator_lb__rb_ use_future_t::operator\[\]] [indexterm2 operator\[\]..use_future_t] -Specify an alternate allocator. +(Deprecated: Use `rebind()`.) Specify an alternate allocator. template< @@ -114926,6 +121859,23 @@ [endsect] + +[section:rebind use_future_t::rebind] + +[indexterm2 rebind..use_future_t] +Specify an alternate allocator. + + + template< + typename OtherAllocator> + use_future_t< OtherAllocator > rebind( + const OtherAllocator & allocator) const; + + + +[endsect] + + [section:use_future_t use_future_t::use_future_t] [indexterm2 use_future_t..use_future_t] @@ -114990,7 +121940,7 @@ template< typename ``[link asio.reference.Service Service]``> Service & ``[link asio.reference.use_service.overload2 use_service]``( - io_service & ios); + io_context & ioc); `` [''''»''' [link asio.reference.use_service.overload2 more...]]`` [heading Requirements] @@ -115041,10 +121991,10 @@ template< typename ``[link asio.reference.Service Service]``> Service & use_service( - io_service & ios); + io_context & ioc); -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. +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_context `io_context`] will create a new instance of the service. [heading Parameters] @@ -115052,7 +122002,7 @@ [variablelist -[[ios][The [link asio.reference.io_service `io_service`] object that owns the service.]] +[[ioc][The [link asio.reference.io_context `io_context`] object that owns the service.]] ] @@ -115064,7 +122014,7 @@ [heading Remarks] -This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_service__service `io_service::service`]. +This overload is preserved for backwards compatibility with services that inherit from [link asio.reference.io_context__service `io_context::service`]. @@ -115074,6 +122024,26 @@ [endsect] + +[section:use_service_lt__detail__io_context_impl__gt_ use_service< detail::io_context_impl >] + +[indexterm1 use_service< detail::io_context_impl >] + + template<> + detail::io_context_impl & use_service< detail::io_context_impl >( + io_context & ioc); + + +[heading Requirements] + +['Header: ][^asio/impl/io_context.hpp] + +['Convenience header: ][^asio.hpp] + + +[endsect] + + [section:uses_executor uses_executor] @@ -115198,7 +122168,7 @@ typename Clock, typename ``[link asio.reference.WaitTraits WaitTraits]`` = asio::wait_traits<Clock>> class waitable_timer_service : - public io_service::service + public io_context::service [heading Types] @@ -115296,8 +122266,13 @@ ] [ + [[link asio.reference.waitable_timer_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.waitable_timer_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -115317,7 +122292,7 @@ [ [[link asio.reference.waitable_timer_service.waitable_timer_service [*waitable_timer_service]]] - [Construct a new timer service for the specified io_service. ] + [Construct a new timer service for the specified io_context. ] ] ] @@ -115600,16 +122575,33 @@ +[section:get_io_context waitable_timer_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..waitable_timer_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service waitable_timer_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..waitable_timer_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -115623,7 +122615,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -115744,11 +122736,11 @@ [section:waitable_timer_service waitable_timer_service::waitable_timer_service] [indexterm2 waitable_timer_service..waitable_timer_service] -Construct a new timer service for the specified [link asio.reference.io_service `io_service`]. +Construct a new timer service for the specified [link asio.reference.io_context `io_context`]. waitable_timer_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -115845,8 +122837,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -115966,7 +122963,7 @@ explicit ``[link asio.reference.windows__basic_handle.basic_handle.overload1 basic_handle]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.windows__basic_handle.basic_handle.overload1 more...]]`` @@ -115974,7 +122971,7 @@ ``[link asio.reference.windows__basic_handle.basic_handle.overload2 basic_handle]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); `` [''''»''' [link asio.reference.windows__basic_handle.basic_handle.overload2 more...]]`` @@ -115994,7 +122991,7 @@ basic_handle( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a handle without opening it. @@ -116005,7 +123002,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] ] @@ -116023,7 +123020,7 @@ basic_handle( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); @@ -116035,7 +123032,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] [[handle][A native handle.]] @@ -116083,7 +123080,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_handle(io_context&) constructor`. @@ -116247,7 +123244,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -116255,38 +123252,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -116296,12 +123293,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -116384,24 +123381,50 @@ [endsect] +[section:get_io_context windows::basic_handle::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..windows::basic_handle] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service windows::basic_handle::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_handle] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -116644,8 +123667,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -116778,7 +123806,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_handle(io_context&) constructor`. @@ -116919,8 +123947,13 @@ ] [ + [[link asio.reference.windows__basic_object_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_object_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -117066,7 +124099,7 @@ 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()`. ]] +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_context::post()`. ]] ] @@ -117083,7 +124116,7 @@ explicit ``[link asio.reference.windows__basic_object_handle.basic_object_handle.overload1 basic_object_handle]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.windows__basic_object_handle.basic_object_handle.overload1 more...]]`` @@ -117091,7 +124124,7 @@ ``[link asio.reference.windows__basic_object_handle.basic_object_handle.overload2 basic_object_handle]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_handle); `` [''''»''' [link asio.reference.windows__basic_object_handle.basic_object_handle.overload2 more...]]`` @@ -117111,7 +124144,7 @@ basic_object_handle( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates an object handle without opening it. @@ -117122,7 +124155,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the object handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the object handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] ] @@ -117140,7 +124173,7 @@ basic_object_handle( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & native_handle); @@ -117152,7 +124185,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the object handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the object handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] [[native_handle][The new underlying handle implementation.]] @@ -117200,7 +124233,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_object_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_object_handle(io_context&) constructor`. @@ -117376,7 +124409,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -117384,38 +124417,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -117425,12 +124458,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -117513,24 +124546,50 @@ [endsect] +[section:get_io_context windows::basic_object_handle::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..windows::basic_object_handle] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service windows::basic_object_handle::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_object_handle] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -117785,8 +124844,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -117922,7 +124986,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_object_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_object_handle(io_context&) constructor`. @@ -118126,8 +125190,13 @@ ] [ + [[link asio.reference.windows__basic_random_access_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -118286,7 +125355,7 @@ std::size_t bytes_transferred // Number of bytes read. ); `` -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()`.]] +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_context::post()`.]] ] @@ -118346,7 +125415,7 @@ std::size_t bytes_transferred // Number of bytes written. ); `` -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()`.]] +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_context::post()`.]] ] @@ -118378,7 +125447,7 @@ explicit ``[link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload1 basic_random_access_handle]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload1 more...]]`` @@ -118386,7 +125455,7 @@ ``[link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 basic_random_access_handle]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); `` [''''»''' [link asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 more...]]`` @@ -118406,7 +125475,7 @@ basic_random_access_handle( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a random-access handle without opening it. The handle needs to be opened before data can be written to or read from it. @@ -118417,7 +125486,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] ] @@ -118435,7 +125504,7 @@ basic_random_access_handle( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); @@ -118447,7 +125516,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] [[handle][The new underlying handle implementation.]] @@ -118495,7 +125564,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_random_access_handle(io_service&)` constructor. +Following the move, the moved-from object is in the same state as if constructed using the `basic_random_access_handle(io_context&)` constructor. @@ -118671,7 +125740,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -118679,38 +125748,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -118720,12 +125789,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -118808,24 +125877,50 @@ [endsect] +[section:get_io_context windows::basic_random_access_handle::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..windows::basic_random_access_handle] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service windows::basic_random_access_handle::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_random_access_handle] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -119080,8 +126175,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -119217,7 +126317,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_random_access_handle(io_service&)` constructor. +Following the move, the moved-from object is in the same state as if constructed using the `basic_random_access_handle(io_context&)` constructor. @@ -119617,8 +126717,13 @@ ] [ + [[link asio.reference.windows__basic_stream_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -119775,7 +126880,7 @@ std::size_t bytes_transferred // Number of bytes read. ); `` -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()`.]] +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_context::post()`.]] ] @@ -119832,7 +126937,7 @@ std::size_t bytes_transferred // Number of bytes written. ); `` -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()`.]] +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_context::post()`.]] ] @@ -119864,7 +126969,7 @@ explicit ``[link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload1 basic_stream_handle]``( - asio::io_service & io_service); + asio::io_context & io_context); `` [''''»''' [link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload1 more...]]`` @@ -119872,7 +126977,7 @@ ``[link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 basic_stream_handle]``( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); `` [''''»''' [link asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 more...]]`` @@ -119892,7 +126997,7 @@ basic_stream_handle( - asio::io_service & io_service); + asio::io_context & io_context); This constructor creates a stream handle without opening it. The handle needs to be opened and then connected or accepted before data can be sent or received on it. @@ -119903,7 +127008,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]] ] @@ -119921,7 +127026,7 @@ basic_stream_handle( - asio::io_service & io_service, + asio::io_context & io_context, const native_handle_type & handle); @@ -119933,7 +127038,7 @@ [variablelist -[[io_service][The [link asio.reference.io_service `io_service`] object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] +[[io_context][The [link asio.reference.io_context `io_context`] object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle.]] [[handle][The new underlying handle implementation.]] @@ -119981,7 +127086,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_handle(io_context&) constructor`. @@ -120157,7 +127262,7 @@ The type of the executor associated with the object. - typedef asio::io_service::executor_type executor_type; + typedef asio::io_context::executor_type executor_type; [heading Member Functions] @@ -120165,38 +127270,38 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.context [*context]]] + [[link asio.reference.io_context__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_context__executor_type.defer [*defer]]] + [Request the io_context 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_context__executor_type.dispatch [*dispatch]]] + [Request the io_context 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_context__executor_type.on_work_finished [*on_work_finished]]] + [Inform the io_context 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_context__executor_type.on_work_started [*on_work_started]]] + [Inform the io_context 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_context__executor_type.post [*post]]] + [Request the io_context 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. ] + [[link asio.reference.io_context__executor_type.running_in_this_thread [*running_in_this_thread]]] + [Determine whether the io_context is running in the current thread. ] ] ] @@ -120206,12 +127311,12 @@ [[Name][Description]] [ - [[link asio.reference.io_service__executor_type.operator_not__eq_ [*operator!=]]] + [[link asio.reference.io_context__executor_type.operator_not__eq_ [*operator!=]]] [Compare two executors for inequality. ] ] [ - [[link asio.reference.io_service__executor_type.operator_eq__eq_ [*operator==]]] + [[link asio.reference.io_context__executor_type.operator_eq__eq_ [*operator==]]] [Compare two executors for equality. ] ] @@ -120294,24 +127399,50 @@ [endsect] +[section:get_io_context windows::basic_stream_handle::get_io_context] + + +['Inherited from basic_io_object.] + +[indexterm2 get_io_context..windows::basic_stream_handle] +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. + + + asio::io_context & get_io_context(); + + +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. + + +[heading Return Value] + +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. + + + + +[endsect] + + + [section:get_io_service windows::basic_stream_handle::get_io_service] ['Inherited from basic_io_object.] [indexterm2 get_io_service..windows::basic_stream_handle] -(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_service `io_service`] associated with the object. +(Deprecated: Use `get_executor()`.) Get the [link asio.reference.io_context `io_context`] associated with the object. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); -This function may be used to obtain the [link asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations. +This function may be used to obtain the [link asio.reference.io_context `io_context`] object that the I/O object uses to dispatch handlers for asynchronous operations. [heading Return Value] -A reference to the [link asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. +A reference to the [link asio.reference.io_context `io_context`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller. @@ -120566,8 +127697,13 @@ ] [ + [[link asio.reference.windows__basic_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -120703,7 +127839,7 @@ [heading Remarks] -Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_handle(io_service&) constructor`. +Following the move, the moved-from object is in the same state as if constructed using the `basic_stream_handle(io_context&) constructor`. @@ -121080,8 +128216,13 @@ ] [ + [[link asio.reference.windows__basic_object_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_object_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -121158,7 +128299,7 @@ class object_handle_service : - public io_service::service + public io_context::service [heading Types] @@ -121216,8 +128357,13 @@ ] [ + [[link asio.reference.windows__object_handle_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.windows__object_handle_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -121242,7 +128388,7 @@ [ [[link asio.reference.windows__object_handle_service.object_handle_service [*object_handle_service]]] - [Construct a new object handle service for the specified io_service. ] + [Construct a new object handle service for the specified io_context. ] ] [ @@ -121367,16 +128513,33 @@ +[section:get_io_context windows::object_handle_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..windows::object_handle_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service windows::object_handle_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..windows::object_handle_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -121390,7 +128553,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -121506,11 +128669,11 @@ [section:object_handle_service windows::object_handle_service::object_handle_service] [indexterm2 object_handle_service..windows::object_handle_service] -Construct a new object handle service for the specified [link asio.reference.io_service `io_service`]. +Construct a new object handle service for the specified [link asio.reference.io_context `io_context`]. object_handle_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -121675,7 +128838,7 @@ template< typename ``[link asio.reference.Handler Handler]``> explicit ``[link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload2 overlapped_ptr]``( - asio::io_service & io_service, + asio::io_context & io_context, Handler && handler); `` [''''»''' [link asio.reference.windows__overlapped_ptr.overlapped_ptr.overload2 more...]]`` @@ -121703,7 +128866,7 @@ template< typename ``[link asio.reference.Handler Handler]``> overlapped_ptr( - asio::io_service & io_service, + asio::io_context & io_context, Handler && handler); @@ -121743,7 +128906,7 @@ template< typename ``[link asio.reference.Handler Handler]``> void ``[link asio.reference.windows__overlapped_ptr.reset.overload2 reset]``( - asio::io_service & io_service, + asio::io_context & io_context, Handler && handler); `` [''''»''' [link asio.reference.windows__overlapped_ptr.reset.overload2 more...]]`` @@ -121771,7 +128934,7 @@ template< typename ``[link asio.reference.Handler Handler]``> void reset( - asio::io_service & io_service, + asio::io_context & io_context, Handler && handler); @@ -121893,8 +129056,13 @@ ] [ + [[link asio.reference.windows__basic_random_access_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -121976,7 +129144,7 @@ class random_access_handle_service : - public io_service::service + public io_context::service [heading Types] @@ -122039,8 +129207,13 @@ ] [ + [[link asio.reference.windows__random_access_handle_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.windows__random_access_handle_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -122065,7 +129238,7 @@ [ [[link asio.reference.windows__random_access_handle_service.random_access_handle_service [*random_access_handle_service]]] - [Construct a new random-access handle service for the specified io_service. ] + [Construct a new random-access handle service for the specified io_context. ] ] [ @@ -122219,16 +129392,33 @@ +[section:get_io_context windows::random_access_handle_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..windows::random_access_handle_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service windows::random_access_handle_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..windows::random_access_handle_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -122242,7 +129432,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -122358,11 +129548,11 @@ [section:random_access_handle_service windows::random_access_handle_service::random_access_handle_service] [indexterm2 random_access_handle_service..windows::random_access_handle_service] -Construct a new random-access handle service for the specified [link asio.reference.io_service `io_service`]. +Construct a new random-access handle service for the specified [link asio.reference.io_context `io_context`]. random_access_handle_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -122507,8 +129697,13 @@ ] [ + [[link asio.reference.windows__basic_stream_handle.get_io_context [*get_io_context]]] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] + ] + + [ [[link asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]] - [(Deprecated: Use get_executor().) Get the io_service associated with the object. ] + [(Deprecated: Use get_executor().) Get the io_context associated with the object. ] ] [ @@ -122591,7 +129786,7 @@ class stream_handle_service : - public io_service::service + public io_context::service [heading Types] @@ -122654,8 +129849,13 @@ ] [ + [[link asio.reference.windows__stream_handle_service.get_io_context [*get_io_context]]] + [Get the io_context object that owns the service. ] + ] + + [ [[link asio.reference.windows__stream_handle_service.get_io_service [*get_io_service]]] - [Get the io_service object that owns the service. ] + [Get the io_context object that owns the service. ] ] [ @@ -122685,7 +129885,7 @@ [ [[link asio.reference.windows__stream_handle_service.stream_handle_service [*stream_handle_service]]] - [Construct a new stream handle service for the specified io_service. ] + [Construct a new stream handle service for the specified io_context. ] ] [ @@ -122832,16 +130032,33 @@ +[section:get_io_context windows::stream_handle_service::get_io_context] + + +['Inherited from io_context.] + +[indexterm2 get_io_context..windows::stream_handle_service] +Get the [link asio.reference.io_context `io_context`] object that owns the service. + + + asio::io_context & get_io_context(); + + + +[endsect] + + + [section:get_io_service windows::stream_handle_service::get_io_service] -['Inherited from io_service.] +['Inherited from io_context.] [indexterm2 get_io_service..windows::stream_handle_service] -Get the [link asio.reference.io_service `io_service`] object that owns the service. +Get the [link asio.reference.io_context `io_context`] object that owns the service. - asio::io_service & get_io_service(); + asio::io_context & get_io_service(); @@ -122855,7 +130072,7 @@ The unique service identifier. - static asio::io_service::id id; + static asio::io_context::id id; @@ -122990,11 +130207,11 @@ [section:stream_handle_service windows::stream_handle_service::stream_handle_service] [indexterm2 stream_handle_service..windows::stream_handle_service] -Construct a new stream handle service for the specified [link asio.reference.io_service `io_service`]. +Construct a new stream handle service for the specified [link asio.reference.io_context `io_context`]. stream_handle_service( - asio::io_service & io_service); + asio::io_context & io_context); @@ -123023,78 +130240,6 @@ [endsect] -[section:wrap wrap] - -[indexterm1 wrap] -Associate an object of type `T` with an executor of type `Executor`. - - - template< - typename ``[link asio.reference.Executor1 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.Executor1 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]
diff --git a/asio/src/doc/tutorial.qbk b/asio/src/doc/tutorial.qbk index 8258826..be3a2c7 100644 --- a/asio/src/doc/tutorial.qbk +++ b/asio/src/doc/tutorial.qbk
@@ -88,23 +88,16 @@ -All programs that use asio need to have at least one -[link asio.reference.io_service io_service] object. This class provides access to I/O functionality. We declare an object of this type first thing in the main function. +All programs that use asio need to have at least one asio::io\_service object. This class provides access to I/O functionality. We declare an object of this type first thing in the main function. - ``''''''``int main() - ``''''''``{ - ``''''''`` asio::io_service io; - Next we declare an object of type asio::deadline\_timer. The core asio classes that provide I/O functionality (or as in this case timer functionality) always take a reference to an io\_service as their first constructor argument. The second argument to the constructor sets the timer to expire 5 seconds from now. - ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(5)); - In this simple example we perform a blocking wait on the timer. That is, the call to [link asio.reference.basic_deadline_timer.wait deadline_timer::wait()] will not return until the timer has expired, 5 seconds after it was created (i.e. not from when the wait starts). @@ -112,7 +105,6 @@ A deadline timer is always in one of two states: "expired" or "not expired". If the [link asio.reference.basic_deadline_timer.wait deadline_timer::wait()] function is called on an expired timer, it will return immediately. - ``''''''`` t.wait(); @@ -120,11 +112,6 @@ - ``''''''`` std::cout << "Hello, world!" << std::endl; - - ``''''''`` return 0; - ``''''''``} - See the [link asio.tutorial.tuttimer1.src full source listing] @@ -154,7 +141,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(5)); ``''''''`` t.wait(); @@ -196,7 +183,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(5)); @@ -209,13 +196,13 @@ -Finally, we must call the [link asio.reference.io_service.run io_service::run()] member function on the io\_service object. +Finally, we must call the asio::io\_service::run() member function on the io\_service object. -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()]. Therefore unless the [link asio.reference.io_service.run io_service::run()] function is called the callback for the asynchronous wait completion will never be invoked. +The asio library provides a guarantee that callback handlers will only be called from threads that are currently calling asio::io\_service::run(). Therefore unless the asio::io\_service::run() function is called the callback for the asynchronous wait completion will never be invoked. -The [link asio.reference.io_service.run io_service::run()] function will also continue to run while there is still "work" to do. In this example, the work is the asynchronous wait on the timer, so the call will not return until the timer has expired and the callback has completed. +The asio::io\_service::run() function will also continue to run while there is still "work" to do. In this example, the work is the asynchronous wait on the timer, so the call will not return until the timer has expired and the callback has completed. -It is important to remember to give the io\_service some work to do before calling [link asio.reference.io_service.run io_service::run()]. For example, if we had omitted the above call to [link asio.reference.basic_deadline_timer.async_wait deadline_timer::async_wait()], the io\_service would not have had any work to do, and consequently [link asio.reference.io_service.run io_service::run()] would have returned immediately. +It is important to remember to give the io\_service some work to do before calling asio::io\_service::run(). For example, if we had omitted the above call to [link asio.reference.basic_deadline_timer.async_wait deadline_timer::async_wait()], the io\_service would not have had any work to do, and consequently asio::io\_service::run() would have returned immediately. ``''''''`` io.run(); @@ -259,7 +246,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(5)); ``''''''`` t.async_wait(&print); @@ -307,7 +294,7 @@ -As mentioned above, this tutorial program uses a counter to stop running when the timer fires for the sixth time. However you will observe that there is no explicit call to ask the io\_service to stop. Recall that in tutorial Timer.2 we learnt that the [link asio.reference.io_service.run io_service::run()] function completes when there is no more "work" to do. By not starting a new asynchronous wait on the timer when `count` reaches 5, the io\_service will run out of work and stop running. +As mentioned above, this tutorial program uses a counter to stop running when the timer fires for the sixth time. However you will observe that there is no explicit call to ask the io\_service to stop. Recall that in tutorial Timer.2 we learnt that the asio::io\_service::run() function completes when there is no more "work" to do. By not starting a new asynchronous wait on the timer when `count` reaches 5, the io\_service will run out of work and stop running. ``''''''`` if (*count < 5) @@ -332,14 +319,6 @@ In this example, the asio::placeholders::error argument to [link asio.tutorial.boost_bind boost::bind] is a named placeholder for the error object passed to the handler. When initiating the asynchronous operation, and if using [link asio.tutorial.boost_bind boost::bind] , you must specify only the arguments that match the handler's parameter list. In tutorial Timer.4 you will see that this placeholder may be elided if the parameter is not needed by the callback handler. - ``''''''`` t->async_wait(boost::bind(print, - ``''''''`` asio::placeholders::error, t, count)); - ``''''''`` } - ``''''''``} - - ``''''''``int main() - ``''''''``{ - ``''''''`` asio::io_service io; @@ -347,18 +326,11 @@ - ``''''''`` int count = 0; - ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(1)); - As in Step 4, when making the call to [link asio.reference.basic_deadline_timer.async_wait deadline_timer::async_wait()] from `main` we bind the additional parameters needed for the `print` function. - ``''''''`` t.async_wait(boost::bind(print, - ``''''''`` asio::placeholders::error, &t, &count)); - - ``''''''`` io.run(); @@ -366,11 +338,6 @@ - ``''''''`` std::cout << "Final count is " << count << std::endl; - - ``''''''`` return 0; - ``''''''``} - See the [link asio.tutorial.tuttimer3.src full source listing] @@ -417,7 +384,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` int count = 0; ``''''''`` asio::deadline_timer t(io, boost::posix_time::seconds(1)); @@ -466,7 +433,7 @@ The constructor of this class will take a reference to the io\_service object and use it when initialising the `timer_` member. The counter used to shut down the program is now also a member of the class. - ``''''''`` printer(asio::io_service& io) + ``''''''`` printer(asio::io_context& io) ``''''''`` : timer_(io, boost::posix_time::seconds(1)), ``''''''`` count_(0) ``''''''`` { @@ -523,7 +490,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` printer p(io); ``''''''`` io.run(); @@ -565,7 +532,7 @@ ``''''''``class printer ``''''''``{ ``''''''``public: - ``''''''`` printer(asio::io_service& io) + ``''''''`` printer(asio::io_context& io) ``''''''`` : timer_(io, boost::posix_time::seconds(1)), ``''''''`` count_(0) ``''''''`` { @@ -596,7 +563,7 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` printer p(io); ``''''''`` io.run(); @@ -611,10 +578,9 @@ [section:tuttimer5 Timer.5 - Synchronising handlers in multithreaded programs] -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. +This tutorial demonstrates the use of the asio::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. +The previous four tutorials avoided the issue of handler synchronisation by calling the asio::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 asio::io\_service::run(). Consequently, calling asio::io\_service::run() from only one thread ensures that callback handlers cannot run concurrently. The single threaded approach is usually the best place to start when developing applications using asio. The downside is the limitations it places on programs, particularly servers, including: @@ -626,7 +592,7 @@ -If you find yourself running into these limitations, an alternative approach is to have a pool of threads calling [link asio.reference.io_service.run io_service::run()]. However, as this allows handlers to execute concurrently, we need a method of synchronisation when handlers might be accessing a shared, thread-unsafe resource. +If you find yourself running into these limitations, an alternative approach is to have a pool of threads calling asio::io\_service::run(). However, as this allows handlers to execute concurrently, we need a method of synchronisation when handlers might be accessing a shared, thread-unsafe resource. @@ -650,16 +616,12 @@ -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]. +In addition to initialising a pair of asio::deadline\_timer members, the constructor initialises the `strand_` member, an object of type asio::io\_service::strand. -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. +An asio::io\_service::strand is an executor that 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 asio::io\_service::run(). Of course, the handlers may still execute concurrently with other handlers that were not dispatched through an asio::io\_service::strand, or were dispatched through a different asio::io\_service::strand object. - ``''''''`` printer(asio::io_service& io) + ``''''''`` printer(asio::io_context& io) ``''''''`` : strand_(io), ``''''''`` timer1_(io, boost::posix_time::seconds(1)), ``''''''`` timer2_(io, boost::posix_time::seconds(1)), @@ -668,16 +630,13 @@ -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. +When initiating the asynchronous operations, each callback handler is "bound" to an asio::io\_service::strand object. The asio::io\_service::strand::bind\_executor() function returns a new handler that automatically dispatches its contained handler through the asio::io\_service::strand object. By binding the handlers to the same asio::io\_service::strand, we are ensuring that they cannot execute concurrently. - ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` timer1_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print1, this))); - ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` timer2_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } @@ -701,7 +660,7 @@ ``''''''`` timer1_.expires_at(timer1_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` timer1_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print1, this))); ``''''''`` } ``''''''`` } @@ -715,13 +674,13 @@ ``''''''`` timer2_.expires_at(timer2_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` timer2_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` } ``''''''``private: - ``''''''`` asio::io_service::strand strand_; + ``''''''`` asio::io_context::strand strand_; ``''''''`` asio::deadline_timer timer1_; ``''''''`` asio::deadline_timer timer2_; ``''''''`` int count_; @@ -729,18 +688,18 @@ -The `main` function now causes [link asio.reference.io_service.run io_service::run()] to be called from two threads: the main thread and one additional thread. This is accomplished using an +The `main` function now causes asio::io\_service::run() to be called from two threads: the main thread and one additional thread. This is accomplished using an [link asio.reference.thread thread] object. -Just as it would with a call from a single thread, concurrent calls to [link asio.reference.io_service.run io_service::run()] will continue to execute while there is "work" left to do. The background thread will not exit until all asynchronous operations have completed. +Just as it would with a call from a single thread, concurrent calls to asio::io\_service::run() will continue to execute while there is "work" left to do. The background thread will not exit until all asynchronous operations have completed. ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` printer p(io); - ``''''''`` asio::thread t(boost::bind(&asio::io_service::run, &io)); + ``''''''`` asio::thread t(boost::bind(&asio::io_context::run, &io)); ``''''''`` io.run(); ``''''''`` t.join(); @@ -780,16 +739,16 @@ ``''''''``class printer ``''''''``{ ``''''''``public: - ``''''''`` printer(asio::io_service& io) + ``''''''`` printer(asio::io_context& io) ``''''''`` : strand_(io), ``''''''`` timer1_(io, boost::posix_time::seconds(1)), ``''''''`` timer2_(io, boost::posix_time::seconds(1)), ``''''''`` count_(0) ``''''''`` { - ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` timer1_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print1, this))); - ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` timer2_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } @@ -807,7 +766,7 @@ ``''''''`` timer1_.expires_at(timer1_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer1_.async_wait(asio::wrap(strand_, + ``''''''`` timer1_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print1, this))); ``''''''`` } ``''''''`` } @@ -821,13 +780,13 @@ ``''''''`` timer2_.expires_at(timer2_.expires_at() + boost::posix_time::seconds(1)); - ``''''''`` timer2_.async_wait(asio::wrap(strand_, + ``''''''`` timer2_.async_wait(asio::bind_executor(strand_, ``''''''`` boost::bind(&printer::print2, this))); ``''''''`` } ``''''''`` } ``''''''``private: - ``''''''`` asio::io_service::strand strand_; + ``''''''`` asio::io_context::strand strand_; ``''''''`` asio::deadline_timer timer1_; ``''''''`` asio::deadline_timer timer2_; ``''''''`` int count_; @@ -835,9 +794,9 @@ ``''''''``int main() ``''''''``{ - ``''''''`` asio::io_service io; + ``''''''`` asio::io_context io; ``''''''`` printer p(io); - ``''''''`` asio::thread t(boost::bind(&asio::io_service::run, &io)); + ``''''''`` asio::thread t(boost::bind(&asio::io_context::run, &io)); ``''''''`` io.run(); ``''''''`` t.join(); @@ -885,34 +844,27 @@ -All programs that use asio need to have at least one -[link asio.reference.io_service io_service] object. +All programs that use asio need to have at least one asio::io\_service object. - ``''''''`` asio::io_service io_service; - We need to turn the server name that was specified as a parameter to the application, into a TCP endpoint. To do this we use an [link asio.reference.ip__tcp.resolver ip::tcp::resolver] object. - ``''''''`` tcp::resolver resolver(io_service); - A resolver takes a query object and turns it into a list of endpoints. We construct a query using the name of the server, specified in `argv[1]`, and the name of the service, in this case `"daytime"`. - ``''''''`` tcp::resolver::query query(argv[1], "daytime"); The list of endpoints is returned using an iterator of type [link asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator]. (Note that a default constructed [link asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator] object can be used as an end iterator.) - ``''''''`` tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); @@ -920,9 +872,6 @@ - ``''''''`` tcp::socket socket(io_service); - ``''''''`` asio::connect(socket, endpoint_iterator); - The connection is open. All we need to do now is read the response from the daytime service. @@ -931,37 +880,17 @@ - ``''''''`` for (;;) - ``''''''`` { - ``''''''`` boost::array<char, 128> buf; - ``''''''`` asio::error_code error; - - ``''''''`` size_t len = socket.read_some(asio::buffer(buf), error); - When the server closes the connection, the [link asio.reference.basic_stream_socket.read_some ip::tcp::socket::read_some()] function will exit with the asio::error::eof error, which is how we know to exit the loop. - ``''''''`` if (error == asio::error::eof) - ``''''''`` break; // Connection closed cleanly by peer. - ``''''''`` else if (error) - ``''''''`` throw asio::system_error(error); // Some other error. - - ``''''''`` std::cout.write(buf.data(), len); - ``''''''`` } - Finally, handle any exceptions that may have been thrown. - ``''''''`` } - ``''''''`` catch (std::exception& e) - ``''''''`` { - ``''''''`` std::cerr << e.what() << std::endl; - ``''''''`` } @@ -1002,14 +931,14 @@ ``''''''`` return 1; ``''''''`` } - ``''''''`` asio::io_service io_service; + ``''''''`` asio::io_context io_context; - ``''''''`` tcp::resolver resolver(io_service); - ``''''''`` tcp::resolver::query query(argv[1], "daytime"); - ``''''''`` tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); + ``''''''`` tcp::resolver resolver(io_context); + ``''''''`` tcp::resolver::results_type endpoints = + ``''''''`` resolver.resolve(argv[1], "daytime"); - ``''''''`` tcp::socket socket(io_service); - ``''''''`` asio::connect(socket, endpoint_iterator); + ``''''''`` tcp::socket socket(io_context); + ``''''''`` asio::connect(socket, endpoints); ``''''''`` for (;;) ``''''''`` { @@ -1062,63 +991,29 @@ - ``''''''``std::string make_daytime_string() - ``''''''``{ - ``''''''`` using namespace std; // For time_t, time and ctime; - ``''''''`` time_t now = time(0); - ``''''''`` return ctime(&now); - ``''''''``} - - ``''''''``int main() - ``''''''``{ - ``''''''`` try - ``''''''`` { - ``''''''`` asio::io_service io_service; - A [link asio.reference.ip__tcp.acceptor ip::tcp::acceptor] object needs to be created to listen for new connections. It is initialised to listen on TCP port 13, for IP version 4. - ``''''''`` tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 13)); - This is an iterative server, which means that it will handle one connection at a time. Create a socket that will represent the connection to the client, and then wait for a connection. - ``''''''`` for (;;) - ``''''''`` { - ``''''''`` tcp::socket socket(io_service); - ``''''''`` acceptor.accept(socket); - A client is accessing our service. Determine the current time and transfer this information to the client. - ``''''''`` std::string message = make_daytime_string(); - - ``''''''`` asio::error_code ignored_error; - ``''''''`` asio::write(socket, asio::buffer(message), ignored_error); - ``''''''`` } - ``''''''`` } - Finally, handle any exceptions. - ``''''''`` catch (std::exception& e) - ``''''''`` { - ``''''''`` std::cerr << e.what() << std::endl; - ``''''''`` } - - ``''''''`` return 0; - ``''''''``} @@ -1163,13 +1058,13 @@ ``''''''``{ ``''''''`` try ``''''''`` { - ``''''''`` asio::io_service io_service; + ``''''''`` asio::io_context io_context; - ``''''''`` tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), 13)); + ``''''''`` tcp::acceptor acceptor(io_context, tcp::endpoint(tcp::v4(), 13)); ``''''''`` for (;;) ``''''''`` { - ``''''''`` tcp::socket socket(io_service); + ``''''''`` tcp::socket socket(io_context); ``''''''`` acceptor.accept(socket); ``''''''`` std::string message = make_daytime_string(); @@ -1204,20 +1099,18 @@ -We need to create a server object to accept incoming client connections. The -[link asio.reference.io_service io_service] object provides I/O services, such as sockets, that the server object will use. +We need to create a server object to accept incoming client connections. The asio::io\_service object provides I/O services, such as sockets, that the server object will use. - ``''''''`` asio::io_service io_service; - ``''''''`` tcp_server server(io_service); + ``''''''`` asio::io_context io_context; + ``''''''`` tcp_server server(io_context); -Run the -[link asio.reference.io_service io_service] object so that it will perform asynchronous operations on your behalf. +Run the asio::io\_service object so that it will perform asynchronous operations on your behalf. - ``''''''`` io_service.run(); + ``''''''`` io_context.run(); ``''''''`` } ``''''''`` catch (std::exception& e) ``''''''`` { @@ -1241,8 +1134,8 @@ The constructor initialises an acceptor to listen on TCP port 13. - ``''''''`` tcp_server(asio::io_service& io_service) - ``''''''`` : acceptor_(io_service, tcp::endpoint(tcp::v4(), 13)) + ``''''''`` tcp_server(asio::io_context& io_context) + ``''''''`` : acceptor_(io_context, tcp::endpoint(tcp::v4(), 13)) ``''''''`` { ``''''''`` start_accept(); ``''''''`` } @@ -1294,9 +1187,9 @@ ``''''''``public: ``''''''`` typedef boost::shared_ptr<tcp_connection> pointer; - ``''''''`` static pointer create(asio::io_service& io_service) + ``''''''`` static pointer create(asio::io_context& io_context) ``''''''`` { - ``''''''`` return pointer(new tcp_connection(io_service)); + ``''''''`` return pointer(new tcp_connection(io_context)); ``''''''`` } ``''''''`` tcp::socket& socket() @@ -1339,8 +1232,8 @@ ``''''''`` } ``''''''``private: - ``''''''`` tcp_connection(asio::io_service& io_service) - ``''''''`` : socket_(io_service) + ``''''''`` tcp_connection(asio::io_context& io_context) + ``''''''`` : socket_(io_context) ``''''''`` { ``''''''`` } @@ -1420,9 +1313,9 @@ ``''''''``public: ``''''''`` typedef boost::shared_ptr<tcp_connection> pointer; - ``''''''`` static pointer create(asio::io_service& io_service) + ``''''''`` static pointer create(asio::io_context& io_context) ``''''''`` { - ``''''''`` return pointer(new tcp_connection(io_service)); + ``''''''`` return pointer(new tcp_connection(io_context)); ``''''''`` } ``''''''`` tcp::socket& socket() @@ -1441,8 +1334,8 @@ ``''''''`` } ``''''''``private: - ``''''''`` tcp_connection(asio::io_service& io_service) - ``''''''`` : socket_(io_service) + ``''''''`` tcp_connection(asio::io_context& io_context) + ``''''''`` : socket_(io_context) ``''''''`` { ``''''''`` } @@ -1458,8 +1351,8 @@ ``''''''``class tcp_server ``''''''``{ ``''''''``public: - ``''''''`` tcp_server(asio::io_service& io_service) - ``''''''`` : acceptor_(io_service, tcp::endpoint(tcp::v4(), 13)) + ``''''''`` tcp_server(asio::io_context& io_context) + ``''''''`` : acceptor_(io_context, tcp::endpoint(tcp::v4(), 13)) ``''''''`` { ``''''''`` start_accept(); ``''''''`` } @@ -1493,9 +1386,9 @@ ``''''''``{ ``''''''`` try ``''''''`` { - ``''''''`` asio::io_service io_service; - ``''''''`` tcp_server server(io_service); - ``''''''`` io_service.run(); + ``''''''`` asio::io_context io_context; + ``''''''`` tcp_server server(io_context); + ``''''''`` io_context.run(); ``''''''`` } ``''''''`` catch (std::exception& e) ``''''''`` { @@ -1528,33 +1421,17 @@ - ``''''''``int main(int argc, char* argv[]) - ``''''''``{ - ``''''''`` try - ``''''''`` { - ``''''''`` if (argc != 2) - ``''''''`` { - ``''''''`` std::cerr << "Usage: client <host>" << std::endl; - ``''''''`` return 1; - ``''''''`` } - - ``''''''`` asio::io_service io_service; - We use an [link asio.reference.ip__udp.resolver ip::udp::resolver] object to find the correct remote endpoint to use based on the host and service names. The query is restricted to return only IPv4 endpoints by the [link asio.reference.ip__udp.v4 ip::udp::v4()] argument. - ``''''''`` udp::resolver resolver(io_service); - ``''''''`` udp::resolver::query query(udp::v4(), argv[1], "daytime"); - The [link asio.reference.ip__basic_resolver.resolve ip::udp::resolver::resolve()] function is guaranteed to return at least one endpoint in the list if it does not fail. This means it is safe to dereference the return value directly. - ``''''''`` udp::endpoint receiver_endpoint = *resolver.resolve(query); @@ -1562,38 +1439,17 @@ - ``''''''`` udp::socket socket(io_service); - ``''''''`` socket.open(udp::v4()); - - ``''''''`` boost::array<char, 1> send_buf = {{ 0 }}; - ``''''''`` socket.send_to(asio::buffer(send_buf), receiver_endpoint); - Now we need to be ready to accept whatever the server sends back to us. The endpoint on our side that receives the server's response will be initialised by [link asio.reference.basic_datagram_socket.receive_from ip::udp::socket::receive_from()]. - ``''''''`` boost::array<char, 128> recv_buf; - ``''''''`` udp::endpoint sender_endpoint; - ``''''''`` size_t len = socket.receive_from( - ``''''''`` asio::buffer(recv_buf), sender_endpoint); - - ``''''''`` std::cout.write(recv_buf.data(), len); - ``''''''`` } - Finally, handle any exceptions that may have been thrown. - ``''''''`` catch (std::exception& e) - ``''''''`` { - ``''''''`` std::cerr << e.what() << std::endl; - ``''''''`` } - - ``''''''`` return 0; - ``''''''``} See the [link asio.tutorial.tutdaytime4.src full source listing] @@ -1634,13 +1490,13 @@ ``''''''`` return 1; ``''''''`` } - ``''''''`` asio::io_service io_service; + ``''''''`` asio::io_context io_context; - ``''''''`` udp::resolver resolver(io_service); - ``''''''`` udp::resolver::query query(udp::v4(), argv[1], "daytime"); - ``''''''`` udp::endpoint receiver_endpoint = *resolver.resolve(query); + ``''''''`` udp::resolver resolver(io_context); + ``''''''`` udp::endpoint receiver_endpoint = + ``''''''`` *resolver.resolve(udp::v4(), argv[1], "daytime").begin(); - ``''''''`` udp::socket socket(io_service); + ``''''''`` udp::socket socket(io_context); ``''''''`` socket.open(udp::v4()); ``''''''`` boost::array<char, 1> send_buf = {{ 0 }}; @@ -1672,11 +1528,6 @@ This tutorial program shows how to use asio to implement a server application with UDP. - ``''''''``int main() - ``''''''``{ - ``''''''`` try - ``''''''`` { - ``''''''`` asio::io_service io_service; @@ -1684,57 +1535,29 @@ - ``''''''`` udp::socket socket(io_service, udp::endpoint(udp::v4(), 13)); - Wait for a client to initiate contact with us. The remote\_endpoint object will be populated by [link asio.reference.basic_datagram_socket.receive_from ip::udp::socket::receive_from()]. - ``''''''`` for (;;) - ``''''''`` { - ``''''''`` boost::array<char, 1> recv_buf; - ``''''''`` udp::endpoint remote_endpoint; - ``''''''`` asio::error_code error; - ``''''''`` socket.receive_from(asio::buffer(recv_buf), - ``''''''`` remote_endpoint, 0, error); - - ``''''''`` if (error && error != asio::error::message_size) - ``''''''`` throw asio::system_error(error); - Determine what we are going to send back to the client. - ``''''''`` std::string message = make_daytime_string(); - Send the response to the remote\_endpoint. - ``''''''`` asio::error_code ignored_error; - ``''''''`` socket.send_to(asio::buffer(message), - ``''''''`` remote_endpoint, 0, ignored_error); - ``''''''`` } - ``''''''`` } - Finally, handle any exceptions. - ``''''''`` catch (std::exception& e) - ``''''''`` { - ``''''''`` std::cerr << e.what() << std::endl; - ``''''''`` } - - ``''''''`` return 0; - ``''''''``} @@ -1780,9 +1603,9 @@ ``''''''``{ ``''''''`` try ``''''''`` { - ``''''''`` asio::io_service io_service; + ``''''''`` asio::io_context io_context; - ``''''''`` udp::socket socket(io_service, udp::endpoint(udp::v4(), 13)); + ``''''''`` udp::socket socket(io_context, udp::endpoint(udp::v4(), 13)); ``''''''`` for (;;) ``''''''`` { @@ -1828,13 +1651,12 @@ -Create a server object to accept incoming client requests, and run the -[link asio.reference.io_service io_service] object. +Create a server object to accept incoming client requests, and run the asio::io\_service object. - ``''''''`` asio::io_service io_service; - ``''''''`` udp_server server(io_service); - ``''''''`` io_service.run(); + ``''''''`` asio::io_context io_context; + ``''''''`` udp_server server(io_context); + ``''''''`` io_context.run(); ``''''''`` } ``''''''`` catch (std::exception& e) ``''''''`` { @@ -1858,8 +1680,8 @@ The constructor initialises a socket to listen on UDP port 13. - ``''''''`` udp_server(asio::io_service& io_service) - ``''''''`` : socket_(io_service, udp::endpoint(udp::v4(), 13)) + ``''''''`` udp_server(asio::io_context& io_context) + ``''''''`` : socket_(io_context, udp::endpoint(udp::v4(), 13)) ``''''''`` { ``''''''`` start_receive(); ``''''''`` } @@ -1870,8 +1692,7 @@ -The function [link asio.reference.basic_datagram_socket.async_receive_from ip::udp::socket::async_receive_from()] will cause the application to listen in the background for a new request. When such a request is received, the -[link asio.reference.io_service io_service] object will invoke the `handle_receive()` function with two arguments: a value of type +The function [link asio.reference.basic_datagram_socket.async_receive_from ip::udp::socket::async_receive_from()] will cause the application to listen in the background for a new request. When such a request is received, the asio::io\_service object will invoke the `handle_receive()` function with two arguments: a value of type [link asio.reference.error_code error_code] indicating whether the operation succeeded or failed, and a `size_t` value `bytes_transferred` specifying the number of bytes received. @@ -1894,8 +1715,7 @@ -The `error` parameter contains the result of the asynchronous operation. Since we only provide the 1-byte `recv_buffer_` to contain the client's request, the -[link asio.reference.io_service io_service] object would return an error if the client sent anything larger. We can ignore such an error if it comes up. +The `error` parameter contains the result of the asynchronous operation. Since we only provide the 1-byte `recv_buffer_` to contain the client's request, the asio::io\_service object would return an error if the client sent anything larger. We can ignore such an error if it comes up. ``''''''`` if (!error || error == asio::error::message_size) @@ -2000,8 +1820,8 @@ ``''''''``class udp_server ``''''''``{ ``''''''``public: - ``''''''`` udp_server(asio::io_service& io_service) - ``''''''`` : socket_(io_service, udp::endpoint(udp::v4(), 13)) + ``''''''`` udp_server(asio::io_context& io_context) + ``''''''`` : socket_(io_context, udp::endpoint(udp::v4(), 13)) ``''''''`` { ``''''''`` start_receive(); ``''''''`` } @@ -2048,9 +1868,9 @@ ``''''''``{ ``''''''`` try ``''''''`` { - ``''''''`` asio::io_service io_service; - ``''''''`` udp_server server(io_service); - ``''''''`` io_service.run(); + ``''''''`` asio::io_context io_context; + ``''''''`` udp_server server(io_context); + ``''''''`` io_context.run(); ``''''''`` } ``''''''`` catch (std::exception& e) ``''''''`` { @@ -2073,41 +1893,24 @@ [heading The main() function] - ``''''''``int main() - ``''''''``{ - ``''''''`` try - ``''''''`` { - ``''''''`` asio::io_service io_service; We will begin by creating a server object to accept a TCP client connection. - ``''''''`` tcp_server server1(io_service); We also need a server object to accept a UDP client request. - ``''''''`` udp_server server2(io_service); -We have created two lots of work for the -[link asio.reference.io_service io_service] object to do. +We have created two lots of work for the asio::io\_service object to do. - ``''''''`` io_service.run(); - ``''''''`` } - ``''''''`` catch (std::exception& e) - ``''''''`` { - ``''''''`` std::cerr << e.what() << std::endl; - ``''''''`` } - - ``''''''`` return 0; - ``''''''``} @@ -2122,9 +1925,9 @@ ``''''''``public: ``''''''`` typedef boost::shared_ptr<tcp_connection> pointer; - ``''''''`` static pointer create(asio::io_service& io_service) + ``''''''`` static pointer create(asio::io_context& io_context) ``''''''`` { - ``''''''`` return pointer(new tcp_connection(io_service)); + ``''''''`` return pointer(new tcp_connection(io_context)); ``''''''`` } ``''''''`` tcp::socket& socket() @@ -2141,8 +1944,8 @@ ``''''''`` } ``''''''``private: - ``''''''`` tcp_connection(asio::io_service& io_service) - ``''''''`` : socket_(io_service) + ``''''''`` tcp_connection(asio::io_context& io_context) + ``''''''`` : socket_(io_context) ``''''''`` { ``''''''`` } @@ -2157,8 +1960,8 @@ ``''''''``class tcp_server ``''''''``{ ``''''''``public: - ``''''''`` tcp_server(asio::io_service& io_service) - ``''''''`` : acceptor_(io_service, tcp::endpoint(tcp::v4(), 13)) + ``''''''`` tcp_server(asio::io_context& io_context) + ``''''''`` : acceptor_(io_context, tcp::endpoint(tcp::v4(), 13)) ``''''''`` { ``''''''`` start_accept(); ``''''''`` } @@ -2198,8 +2001,8 @@ ``''''''``class udp_server ``''''''``{ ``''''''``public: - ``''''''`` udp_server(asio::io_service& io_service) - ``''''''`` : socket_(io_service, udp::endpoint(udp::v4(), 13)) + ``''''''`` udp_server(asio::io_context& io_context) + ``''''''`` : socket_(io_context, udp::endpoint(udp::v4(), 13)) ``''''''`` { ``''''''`` start_receive(); ``''''''`` } @@ -2284,9 +2087,9 @@ ``''''''``public: ``''''''`` typedef boost::shared_ptr<tcp_connection> pointer; - ``''''''`` static pointer create(asio::io_service& io_service) + ``''''''`` static pointer create(asio::io_context& io_context) ``''''''`` { - ``''''''`` return pointer(new tcp_connection(io_service)); + ``''''''`` return pointer(new tcp_connection(io_context)); ``''''''`` } ``''''''`` tcp::socket& socket() @@ -2303,8 +2106,8 @@ ``''''''`` } ``''''''``private: - ``''''''`` tcp_connection(asio::io_service& io_service) - ``''''''`` : socket_(io_service) + ``''''''`` tcp_connection(asio::io_context& io_context) + ``''''''`` : socket_(io_context) ``''''''`` { ``''''''`` } @@ -2319,8 +2122,8 @@ ``''''''``class tcp_server ``''''''``{ ``''''''``public: - ``''''''`` tcp_server(asio::io_service& io_service) - ``''''''`` : acceptor_(io_service, tcp::endpoint(tcp::v4(), 13)) + ``''''''`` tcp_server(asio::io_context& io_context) + ``''''''`` : acceptor_(io_context, tcp::endpoint(tcp::v4(), 13)) ``''''''`` { ``''''''`` start_accept(); ``''''''`` } @@ -2353,8 +2156,8 @@ ``''''''``class udp_server ``''''''``{ ``''''''``public: - ``''''''`` udp_server(asio::io_service& io_service) - ``''''''`` : socket_(io_service, udp::endpoint(udp::v4(), 13)) + ``''''''`` udp_server(asio::io_context& io_context) + ``''''''`` : socket_(io_context, udp::endpoint(udp::v4(), 13)) ``''''''`` { ``''''''`` start_receive(); ``''''''`` } @@ -2395,10 +2198,10 @@ ``''''''``{ ``''''''`` try ``''''''`` { - ``''''''`` asio::io_service io_service; - ``''''''`` tcp_server server1(io_service); - ``''''''`` udp_server server2(io_service); - ``''''''`` io_service.run(); + ``''''''`` asio::io_context io_context; + ``''''''`` tcp_server server1(io_context); + ``''''''`` udp_server server2(io_context); + ``''''''`` io_context.run(); ``''''''`` } ``''''''`` catch (std::exception& e) ``''''''`` {