net: change ConnectSocketDirectly() to take a Sock argument

Change `ConnectSocketDirectly()` to take a `Sock` argument instead of a
bare `SOCKET`. With this, use the `Sock`'s (possibly mocked) methods
`Connect()`, `Wait()` and `GetSockOpt()` instead of calling the OS
functions directly.
This commit is contained in:
Vasil Dimov
2021-03-05 17:01:59 +01:00
parent b5861100f8
commit 82d360b5a8
4 changed files with 27 additions and 40 deletions

View File

@@ -448,7 +448,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
if (!sock) {
return nullptr;
}
connected = ConnectSocketDirectly(addrConnect, sock->Get(), nConnectTimeout,
connected = ConnectSocketDirectly(addrConnect, *sock, nConnectTimeout,
conn_type == ConnectionType::MANUAL);
}
if (!proxyConnectionFailed) {