[#ConnectDirectly-0e]
= ConnectDirectly
:mrdocs:

Create a socket and try to connect to the specified service&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::unique&lowbar;ptr&lt;Sock&gt;
ConnectDirectly(
    xref:CService.adoc[CService] const& dest,
    bool manual&lowbar;connection);
----

== Return Value

the connected socket if the operation succeeded, empty unique&lowbar;ptr otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dest* [in]
| The service to which to connect&period;
| *manual&lowbar;connection* [in]
| Whether or not the connection was manually requested (e&period;g&period; through the addnode RPC)
|===


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