diff options
Diffstat (limited to 'doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html')
-rw-r--r-- | doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html b/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html index f3d34d1467..b7c9e23a06 100644 --- a/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html +++ b/doc/html/boost_asio/reference/basic_socket_acceptor/async_accept/overload5.html @@ -1,13 +1,13 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> -<title>basic_socket_acceptor::async_accept (5 of 6 overloads)</title> +<title>basic_socket_acceptor::async_accept (5 of 8 overloads)</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../async_accept.html" title="basic_socket_acceptor::async_accept"> -<link rel="prev" href="overload4.html" title="basic_socket_acceptor::async_accept (4 of 6 overloads)"> -<link rel="next" href="overload6.html" title="basic_socket_acceptor::async_accept (6 of 6 overloads)"> +<link rel="prev" href="overload4.html" title="basic_socket_acceptor::async_accept (4 of 8 overloads)"> +<link rel="next" href="overload6.html" title="basic_socket_acceptor::async_accept (6 of 8 overloads)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> @@ -24,17 +24,19 @@ </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> -<a name="boost_asio.reference.basic_socket_acceptor.async_accept.overload5"></a><a class="link" href="overload5.html" title="basic_socket_acceptor::async_accept (5 of 6 overloads)">basic_socket_acceptor::async_accept - (5 of 6 overloads)</a> +<a name="boost_asio.reference.basic_socket_acceptor.async_accept.overload5"></a><a class="link" href="overload5.html" title="basic_socket_acceptor::async_accept (5 of 8 overloads)">basic_socket_acceptor::async_accept + (5 of 8 overloads)</a> </h5></div></div></div> <p> Start an asynchronous accept. </p> <pre class="programlisting">template< + typename ExecutionContext, typename <a class="link" href="../../MoveAcceptHandler.html" title="Move accept handler requirements">MoveAcceptHandler</a>> <a class="link" href="../../asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> async_accept( - endpoint_type & peer_endpoint, - MoveAcceptHandler && handler); + ExecutionContext & context, + MoveAcceptHandler && handler, + typename enable_if< is_convertible< ExecutionContext &, execution_context & >::value >::type * = 0); </pre> <p> This function is used to asynchronously accept a new connection. The @@ -51,12 +53,10 @@ <div class="variablelist"> <p class="title"><b></b></p> <dl class="variablelist"> -<dt><span class="term">peer_endpoint</span></dt> +<dt><span class="term">context</span></dt> <dd><p> - 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. + The I/O execution context object to be used for the newly accepted + socket. </p></dd> <dt><span class="term">handler</span></dt> <dd> @@ -67,14 +67,16 @@ </p> <pre class="programlisting">void handler( const boost::system::error_code& error, // Result of operation. - typename Protocol::socket peer // On success, the newly accepted socket. + typename Protocol::socket::template rebind_executor< + typename ExecutionContext::executor_type>::other peer + // On success, the newly accepted socket. ); </pre> <p> 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 <code class="computeroutput">boost::asio::io_context::post()</code>. + On immediate completion, invocation of the handler will be performed + in a manner equivalent to using <a class="link" href="../../post.html" title="post"><code class="computeroutput">post</code></a>. </p> </dd> </dl> @@ -94,15 +96,14 @@ ... -boost::asio::ip::tcp::acceptor acceptor(io_context); +boost::asio::ip::tcp::acceptor acceptor(my_context); ... -boost::asio::ip::tcp::endpoint endpoint; -acceptor.async_accept(endpoint, accept_handler); +acceptor.async_accept(my_context2, accept_handler); </pre> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> -<td align="right"><div class="copyright-footer">Copyright © 2003-2018 Christopher M. Kohlhoff<p> +<td align="right"><div class="copyright-footer">Copyright © 2003-2019 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> |