3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>ip::basic_resolver::async_resolve (5 of 6 overloads)</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../async_resolve.html" title="ip::basic_resolver::async_resolve">
9 <link rel="prev" href="overload4.html" title="ip::basic_resolver::async_resolve (4 of 6 overloads)">
10 <link rel="next" href="overload6.html" title="ip::basic_resolver::async_resolve (6 of 6 overloads)">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="overload4.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../async_resolve.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload6.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload5"></a><a class="link" href="overload5.html" title="ip::basic_resolver::async_resolve (5 of 6 overloads)">ip::basic_resolver::async_resolve
28 (5 of 6 overloads)</a>
29 </h5></div></div></div>
31 Asynchronously perform forward resolution of a query to a list of entries.
33 <pre class="programlisting">template<
34 typename <a class="link" href="../../ResolveHandler.html" title="Resolve handler requirements">ResolveHandler</a> = <a class="link" href="../../asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>>
35 <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_resolve(
36 const protocol_type & protocol,
39 resolver_base::flags resolve_flags,
40 ResolveHandler && handler = <a class="link" href="../../asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>);
43 This function is used to resolve host and service names into a list of
47 <a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload5.h0"></a>
48 <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload5.parameters"></a></span><a class="link" href="overload5.html#boost_asio.reference.ip__basic_resolver.async_resolve.overload5.parameters">Parameters</a>
50 <div class="variablelist">
51 <p class="title"><b></b></p>
52 <dl class="variablelist">
53 <dt><span class="term">protocol</span></dt>
55 A protocol object, normally representing either the IPv4 or IPv6
56 version of an internet protocol.
58 <dt><span class="term">host</span></dt>
60 A string identifying a location. May be a descriptive name or a
61 numeric address string. If an empty string and the passive flag
62 has been specified, the resolved endpoints are suitable for local
63 service binding. If an empty string and passive is not specified,
64 the resolved endpoints will use the loopback address.
66 <dt><span class="term">service</span></dt>
68 A string identifying the requested service. This may be a descriptive
69 name or a numeric string corresponding to a port number. May be
70 an empty string, in which case all resolved endpoints will have
73 <dt><span class="term">resolve_flags</span></dt>
75 A set of flags that determine how name resolution should be performed.
76 The default flags are suitable for communication with remote hosts.
77 See the <a class="link" href="../../ip__resolver_base.html" title="ip::resolver_base"><code class="computeroutput">ip::resolver_base</code></a>
78 documentation for the set of available flags.
80 <dt><span class="term">handler</span></dt>
83 The handler to be called when the resolve operation completes.
84 Copies will be made of the handler as required. The function signature
85 of the handler must be:
87 <pre class="programlisting">void handler(
88 const boost::system::error_code& error, // Result of operation.
89 resolver::results_type results // Resolved endpoints as a range.
93 Regardless of whether the asynchronous operation completes immediately
94 or not, the handler will not be invoked from within this function.
95 On immediate completion, invocation of the handler will be performed
96 in a manner equivalent to using <a class="link" href="../../post.html" title="post"><code class="computeroutput">post</code></a>.
102 A successful resolve operation is guaranteed to pass a non-empty range
106 <a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload5.h1"></a>
107 <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload5.remarks"></a></span><a class="link" href="overload5.html#boost_asio.reference.ip__basic_resolver.async_resolve.overload5.remarks">Remarks</a>
110 On POSIX systems, host names may be locally defined in the file <code class="computeroutput">/etc/hosts</code>.
111 On Windows, host names may be defined in the file <code class="computeroutput">c:\windows\system32\drivers\etc\hosts</code>.
112 Remote host name resolution is performed using DNS. Operating systems
113 may use additional locations when resolving host names (such as NETBIOS
117 On POSIX systems, service names are typically defined in the file <code class="computeroutput">/etc/services</code>.
118 On Windows, service names may be found in the file <code class="computeroutput">c:\windows\system32\drivers\etc\services</code>.
119 Operating systems may use additional locations when resolving service
123 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
124 <td align="left"></td>
125 <td align="right"><div class="copyright-footer">Copyright © 2003-2019 Christopher M. Kohlhoff<p>
126 Distributed under the Boost Software License, Version 1.0. (See accompanying
127 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>)
132 <div class="spirit-nav">
133 <a accesskey="p" href="overload4.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../async_resolve.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload6.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>