1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>ip::basic_resolver::async_resolve (2 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="overload1.html" title="ip::basic_resolver::async_resolve (1 of 6 overloads)"> 10<link rel="next" href="overload3.html" title="ip::basic_resolver::async_resolve (3 of 6 overloads)"> 11</head> 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> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="overload1.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="overload3.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload2"></a><a class="link" href="overload2.html" title="ip::basic_resolver::async_resolve (2 of 6 overloads)">ip::basic_resolver::async_resolve 28 (2 of 6 overloads)</a> 29</h5></div></div></div> 30<p> 31 Asynchronously perform forward resolution of a query to a list of entries. 32 </p> 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 string_view host, 37 string_view service, 38 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>); 39</pre> 40<p> 41 This function is used to resolve host and service names into a list of 42 endpoint entries. 43 </p> 44<h6> 45<a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload2.h0"></a> 46 <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload2.parameters"></a></span><a class="link" href="overload2.html#boost_asio.reference.ip__basic_resolver.async_resolve.overload2.parameters">Parameters</a> 47 </h6> 48<div class="variablelist"> 49<p class="title"><b></b></p> 50<dl class="variablelist"> 51<dt><span class="term">host</span></dt> 52<dd><p> 53 A string identifying a location. May be a descriptive name or a 54 numeric address string. If an empty string and the passive flag 55 has been specified, the resolved endpoints are suitable for local 56 service binding. If an empty string and passive is not specified, 57 the resolved endpoints will use the loopback address. 58 </p></dd> 59<dt><span class="term">service</span></dt> 60<dd><p> 61 A string identifying the requested service. This may be a descriptive 62 name or a numeric string corresponding to a port number. May be 63 an empty string, in which case all resolved endpoints will have 64 a port number of 0. 65 </p></dd> 66<dt><span class="term">handler</span></dt> 67<dd> 68<p> 69 The handler to be called when the resolve operation completes. 70 Copies will be made of the handler as required. The function signature 71 of the handler must be: 72</p> 73<pre class="programlisting">void handler( 74 const boost::system::error_code& error, // Result of operation. 75 resolver::results_type results // Resolved endpoints as a range. 76); 77</pre> 78<p> 79 Regardless of whether the asynchronous operation completes immediately 80 or not, the handler will not be invoked from within this function. 81 On immediate completion, invocation of the handler will be performed 82 in a manner equivalent to using <a class="link" href="../../post.html" title="post"><code class="computeroutput">post</code></a>. 83 </p> 84</dd> 85</dl> 86</div> 87<p> 88 A successful resolve operation is guaranteed to pass a non-empty range 89 to the handler. 90 </p> 91<h6> 92<a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload2.h1"></a> 93 <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.async_resolve.overload2.remarks"></a></span><a class="link" href="overload2.html#boost_asio.reference.ip__basic_resolver.async_resolve.overload2.remarks">Remarks</a> 94 </h6> 95<p> 96 On POSIX systems, host names may be locally defined in the file <code class="computeroutput">/etc/hosts</code>. 97 On Windows, host names may be defined in the file <code class="computeroutput">c:\windows\system32\drivers\etc\hosts</code>. 98 Remote host name resolution is performed using DNS. Operating systems 99 may use additional locations when resolving host names (such as NETBIOS 100 names on Windows). 101 </p> 102<p> 103 On POSIX systems, service names are typically defined in the file <code class="computeroutput">/etc/services</code>. 104 On Windows, service names may be found in the file <code class="computeroutput">c:\windows\system32\drivers\etc\services</code>. 105 Operating systems may use additional locations when resolving service 106 names. 107 </p> 108</div> 109<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 110<td align="left"></td> 111<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 112 Kohlhoff<p> 113 Distributed under the Boost Software License, Version 1.0. (See accompanying 114 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>) 115 </p> 116</div></td> 117</tr></table> 118<hr> 119<div class="spirit-nav"> 120<a accesskey="p" href="overload1.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="overload3.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 121</div> 122</body> 123</html> 124