Changeset View
Changeset View
Standalone View
Standalone View
src/netbase.cpp
Show First 20 Lines • Show All 655 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Try to connect to the specified service on the specified socket. | * Try to connect to the specified service on the specified socket. | ||||
* | * | ||||
* @param addrConnect The service to which to connect. | * @param addrConnect The service to which to connect. | ||||
* @param hSocket The socket on which to connect. | * @param hSocket The socket on which to connect. | ||||
* @param nTimeout Wait this many milliseconds for the connection to be | * @param nTimeout Wait this many milliseconds for the connection to be | ||||
* established. | * established. | ||||
* @param manual_connection Whether or not the connection was manually requested | * @param manual_connection Whether or not the connection was manually requested | ||||
* (e.g. thru the addnode RPC) | * (e.g. through the addnode RPC) | ||||
* | * | ||||
* @returns Whether or not a connection was successfully made. | * @returns Whether or not a connection was successfully made. | ||||
*/ | */ | ||||
bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET &hSocket, | bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET &hSocket, | ||||
int nTimeout, bool manual_connection) { | int nTimeout, bool manual_connection) { | ||||
// Create a sockaddr from the specified service. | // Create a sockaddr from the specified service. | ||||
struct sockaddr_storage sockaddr; | struct sockaddr_storage sockaddr; | ||||
socklen_t len = sizeof(sockaddr); | socklen_t len = sizeof(sockaddr); | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | if (!proxyInfo[net].IsValid()) { | ||||
return false; | return false; | ||||
} | } | ||||
proxyInfoOut = proxyInfo[net]; | proxyInfoOut = proxyInfo[net]; | ||||
return true; | return true; | ||||
} | } | ||||
/** | /** | ||||
* Set the name proxy to use for all connections to nodes specified by a | * Set the name proxy to use for all connections to nodes specified by a | ||||
* hostname. After setting this proxy, connecting to a node sepcified by a | * hostname. After setting this proxy, connecting to a node specified by a | ||||
* hostname won't result in a local lookup of said hostname, rather, connect to | * hostname won't result in a local lookup of said hostname, rather, connect to | ||||
* the node by asking the name proxy for a proxy connection to the hostname, | * the node by asking the name proxy for a proxy connection to the hostname, | ||||
* effectively delegating the hostname lookup to the specified proxy. | * effectively delegating the hostname lookup to the specified proxy. | ||||
* | * | ||||
* This delegation increases privacy for those who set the name proxy as they no | * This delegation increases privacy for those who set the name proxy as they no | ||||
* longer leak their external hostname queries to their DNS servers. | * longer leak their external hostname queries to their DNS servers. | ||||
* | * | ||||
* @returns Whether or not the operation succeeded. | * @returns Whether or not the operation succeeded. | ||||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |