• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>ip::basic_resolver::resolve (10 of 12 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="../resolve.html" title="ip::basic_resolver::resolve">
9<link rel="prev" href="overload9.html" title="ip::basic_resolver::resolve (9 of 12 overloads)">
10<link rel="next" href="overload11.html" title="ip::basic_resolver::resolve (11 of 12 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="overload9.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../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="overload11.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.resolve.overload10"></a><a class="link" href="overload10.html" title="ip::basic_resolver::resolve (10 of 12 overloads)">ip::basic_resolver::resolve
28          (10 of 12 overloads)</a>
29</h5></div></div></div>
30<p>
31            Perform forward resolution of a query to a list of entries.
32          </p>
33<pre class="programlisting">results_type resolve(
34    const protocol_type &amp; protocol,
35    string_view host,
36    string_view service,
37    resolver_base::flags resolve_flags,
38    boost::system::error_code &amp; ec);
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.resolve.overload10.h0"></a>
46            <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.resolve.overload10.parameters"></a></span><a class="link" href="overload10.html#boost_asio.reference.ip__basic_resolver.resolve.overload10.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">protocol</span></dt>
52<dd><p>
53                  A protocol object, normally representing either the IPv4 or IPv6
54                  version of an internet protocol.
55                </p></dd>
56<dt><span class="term">host</span></dt>
57<dd><p>
58                  A string identifying a location. May be a descriptive name or a
59                  numeric address string. If an empty string and the passive flag
60                  has been specified, the resolved endpoints are suitable for local
61                  service binding. If an empty string and passive is not specified,
62                  the resolved endpoints will use the loopback address.
63                </p></dd>
64<dt><span class="term">service</span></dt>
65<dd><p>
66                  A string identifying the requested service. This may be a descriptive
67                  name or a numeric string corresponding to a port number. May be
68                  an empty string, in which case all resolved endpoints will have
69                  a port number of 0.
70                </p></dd>
71<dt><span class="term">resolve_flags</span></dt>
72<dd><p>
73                  A set of flags that determine how name resolution should be performed.
74                  The default flags are suitable for communication with remote hosts.
75                  See the <a class="link" href="../../ip__resolver_base.html" title="ip::resolver_base"><code class="computeroutput">ip::resolver_base</code></a>
76                  documentation for the set of available flags.
77                </p></dd>
78<dt><span class="term">ec</span></dt>
79<dd><p>
80                  Set to indicate what error occurred, if any.
81                </p></dd>
82</dl>
83</div>
84<h6>
85<a name="boost_asio.reference.ip__basic_resolver.resolve.overload10.h1"></a>
86            <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.resolve.overload10.return_value"></a></span><a class="link" href="overload10.html#boost_asio.reference.ip__basic_resolver.resolve.overload10.return_value">Return
87            Value</a>
88          </h6>
89<p>
90            A range object representing the list of endpoint entries. An empty range
91            is returned if an error occurs. A successful call to this function is
92            guaranteed to return a non-empty range.
93          </p>
94<h6>
95<a name="boost_asio.reference.ip__basic_resolver.resolve.overload10.h2"></a>
96            <span class="phrase"><a name="boost_asio.reference.ip__basic_resolver.resolve.overload10.remarks"></a></span><a class="link" href="overload10.html#boost_asio.reference.ip__basic_resolver.resolve.overload10.remarks">Remarks</a>
97          </h6>
98<p>
99            On POSIX systems, host names may be locally defined in the file <code class="computeroutput">/etc/hosts</code>.
100            On Windows, host names may be defined in the file <code class="computeroutput">c:\windows\system32\drivers\etc\hosts</code>.
101            Remote host name resolution is performed using DNS. Operating systems
102            may use additional locations when resolving host names (such as NETBIOS
103            names on Windows).
104          </p>
105<p>
106            On POSIX systems, service names are typically defined in the file <code class="computeroutput">/etc/services</code>.
107            On Windows, service names may be found in the file <code class="computeroutput">c:\windows\system32\drivers\etc\services</code>.
108            Operating systems may use additional locations when resolving service
109            names.
110          </p>
111</div>
112<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
113<td align="left"></td>
114<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M.
115      Kohlhoff<p>
116        Distributed under the Boost Software License, Version 1.0. (See accompanying
117        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>)
118      </p>
119</div></td>
120</tr></table>
121<hr>
122<div class="spirit-nav">
123<a accesskey="p" href="overload9.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../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="overload11.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
124</div>
125</body>
126</html>
127