aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-06-22 14:01:04 -0400
committerCory Fields <cory-nospam-@coryfields.com>2017-09-18 13:47:47 -0400
commit2416dd7cc94e765efbbf9069dbf0f6fb71404ebb (patch)
tree7f66d156ebf5c4e1b4253277abc688c26edd2338 /src/netbase.h
parent44e1fd926cfb0df0fbd8c41de8cd65ed8d5d6e18 (diff)
downloadbitcoin-2416dd7cc94e765efbbf9069dbf0f6fb71404ebb.tar.xz
net: separate resolving and conecting
ConnectSocketByName handled resolves as necessary, obscuring the connection process. With them separated, each can be handled asynchronously. Also, since proxies must be considered now anyway, go ahead and eliminate the ConnectSocket wrapper and use ConnectSocketDirectly... directly.
Diffstat (limited to 'src/netbase.h')
-rw-r--r--src/netbase.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netbase.h b/src/netbase.h
index 6572f0a12e..50425f0f80 100644
--- a/src/netbase.h
+++ b/src/netbase.h
@@ -44,6 +44,7 @@ bool GetProxy(enum Network net, proxyType &proxyInfoOut);
bool IsProxy(const CNetAddr &addr);
bool SetNameProxy(const proxyType &addrProxy);
bool HaveNameProxy();
+bool GetNameProxy(proxyType &nameProxyOut);
bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup);
bool LookupHost(const char *pszName, CNetAddr& addr, bool fAllowLookup);
bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup);
@@ -52,6 +53,8 @@ CService LookupNumeric(const char *pszName, int portDefault = 0);
bool LookupSubNet(const char *pszName, CSubNet& subnet);
bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed = nullptr);
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed = nullptr);
+bool ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRet, int nTimeout);
+bool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int port, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed);
/** Return readable error string for a network error code */
std::string NetworkErrorString(int err);
/** Close socket and set hSocket to INVALID_SOCKET */