[#ConnectDirectly-00] = ConnectDirectly :mrdocs: `ConnectDirectly` overloads == Synopses Declared in `<netbase.h>` Create a socket and try to connect to the specified service. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::unique_ptr<Sock> xref:ConnectDirectly-0e.adoc[ConnectDirectly]( xref:CService.adoc[CService] const& dest, bool manual_connection); ---- [.small]#xref:ConnectDirectly-0e.adoc[_» more..._]# Create a socket and try to connect to the specified service, using the provided timeout. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::unique_ptr<Sock> xref:ConnectDirectly-0c.adoc[ConnectDirectly]( xref:CService.adoc[CService] const& dest, bool manual_connection, std::chrono::milliseconds timeout); ---- [.small]#xref:ConnectDirectly-0c.adoc[_» more..._]# == Return Value * the connected socket if the operation succeeded, empty unique_ptr otherwise * the connected socket if the operation succeeded, empty unique_ptr otherwise. == Parameters [cols="1,4"] |=== | Name| Description | *dest* [in] | The service to which to connect. | *manual_connection* [in] | Whether or not the connection was manually requested (e.g. through the addnode RPC) | *timeout* [in] | How long to wait for the connection before giving up. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#