diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-03-05 17:01:59 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-03-16 13:58:23 +0100 |
commit | 82d360b5a88d9057b6c09b61cd69e426c7a2412d (patch) | |
tree | 8a60f973c2155fa870c30e7919e869cdaee36d0c /src/netbase.h | |
parent | b5861100f85fef77b00f55dcdf01ffb4a2a112d8 (diff) |
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.
Diffstat (limited to 'src/netbase.h')
-rw-r--r-- | src/netbase.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/netbase.h b/src/netbase.h index e98a21ce1f..dc9a952d4f 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -194,7 +194,7 @@ extern std::function<std::unique_ptr<Sock>(const CService&)> CreateSock; * Try to connect to the specified service on the specified socket. * * @param addrConnect The service to which to connect. - * @param hSocket The socket on which to connect. + * @param sock The socket on which to connect. * @param nTimeout Wait this many milliseconds for the connection to be * established. * @param manual_connection Whether or not the connection was manually requested @@ -202,7 +202,7 @@ extern std::function<std::unique_ptr<Sock>(const CService&)> CreateSock; * * @returns Whether or not a connection was successfully made. */ -bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET& hSocket, int nTimeout, bool manual_connection); +bool ConnectSocketDirectly(const CService &addrConnect, const Sock& sock, int nTimeout, bool manual_connection); /** * Connect to a specified destination service through a SOCKS5 proxy by first |