[#Lookup-0d]
= Lookup
:mrdocs:

`Lookup` overloads

== Synopses

Declared in `&lt;netbase&period;h&gt;`

Resolve a service string to its first corresponding service&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;CService&gt;
xref:Lookup-0b.adoc[Lookup](
    std::string const& name,
    uint16&lowbar;t portDefault,
    bool fAllowLookup,
    xref:DNSLookupFn.adoc[DNSLookupFn] dns&lowbar;lookup&lowbar;function = g&lowbar;dns&lowbar;lookup);
----

[.small]#xref:Lookup-0b.adoc[_» more&period;&period;&period;_]#

Resolve a service string to its corresponding service&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::vector&lt;CService&gt;
xref:Lookup-04.adoc[Lookup](
    std::string const& name,
    uint16&lowbar;t portDefault,
    bool fAllowLookup,
    unsigned int nMaxSolutions,
    xref:DNSLookupFn.adoc[DNSLookupFn] dns&lowbar;lookup&lowbar;function = g&lowbar;dns&lowbar;lookup);
----

[.small]#xref:Lookup-04.adoc[_» more&period;&period;&period;_]#

== Return Value

* The first resolved service, or std&colon;&colon;nullopt if the string does not resolve&period;
* The resulting services to which the specified service string resolved&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| The service string to resolve&period;
| *portDefault*
| The port to use when the service string omits one&period;
| *fAllowLookup*
| Whether DNS lookups are permitted&period;
| *dns&lowbar;lookup&lowbar;function*
| The resolver used to perform the lookup&period;
| *nMaxSolutions*
| The maximum number of results we want, specifying 0 means &quot;as many solutions as we get&period;&quot;
|===

== See Also

Lookup(const std&colon;&colon;string&amp;, uint16&lowbar;t, bool, unsigned int, DNSLookupFn) for additional parameter descriptions&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
