Create a socket and try to connect to the specified service, using the provided timeout.
Declared in <netbase.h>
std::unique_ptr<Sock>
ConnectDirectly(
CService const& dest,
bool manual_connection,
std::chrono::milliseconds timeout);
the connected socket if the operation succeeded, empty unique_ptr otherwise.
| 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. |