9 #if defined(HAVE_CONFIG_H)
25 static const int DEFAULT_CONNECT_TIMEOUT = 5000;
27 static const int DEFAULT_NAME_LOOKUP =
true;
43 void SplitHostPort(std::string in,
int& portOut, std::string& hostOut);
50 bool LookupHost(
const std::string&
name, std::vector<CNetAddr>& vIP,
unsigned int nMaxSolutions,
bool fAllowLookup);
52 bool Lookup(
const std::string&
name,
CService& addr,
int portDefault,
bool fAllowLookup);
53 bool Lookup(
const std::string&
name, std::vector<CService>& vAddr,
int portDefault,
bool fAllowLookup,
unsigned int nMaxSolutions);
A combination of a network address (CNetAddr) and a (TCP) port.
bool randomize_credentials
proxyType(const CService &_proxy, bool _randomize_credentials=false)
struct timeval MillisToTimeval(int64_t nTimeout)
Convert milliseconds to a struct timeval for e.g.
bool LookupSubNet(const std::string &name, CSubNet &subnet)
bool GetNameProxy(proxyType &nameProxyOut)
void SplitHostPort(std::string in, int &portOut, std::string &hostOut)
bool SetSocketNoDelay(SOCKET &hSocket)
Set the TCP_NODELAY flag on a socket.
enum Network ParseNetwork(std::string net)
CService LookupNumeric(const std::string &name, int portDefault=0)
std::string GetNetworkName(enum Network net)
bool GetProxy(enum Network net, proxyType &proxyInfoOut)
bool SetSocketNonBlocking(SOCKET &hSocket, bool fNonBlocking)
Disable or enable blocking-mode for a socket.
void InterruptSocks5(bool interrupt)
std::string NetworkErrorString(int err)
Return readable error string for a network error code.
bool LookupHost(const std::string &name, std::vector< CNetAddr > &vIP, unsigned int nMaxSolutions, bool fAllowLookup)
bool ConnectSocketDirectly(const CService &addrConnect, const SOCKET &hSocketRet, int nTimeout, bool manual_connection)
bool SetNameProxy(const proxyType &addrProxy)
bool ConnectThroughProxy(const proxyType &proxy, const std::string &strDest, int port, const SOCKET &hSocketRet, int nTimeout, bool *outProxyConnectionFailed)
bool Lookup(const std::string &name, CService &addr, int portDefault, bool fAllowLookup)
bool CloseSocket(SOCKET &hSocket)
Close socket and set hSocket to INVALID_SOCKET.
bool IsProxy(const CNetAddr &addr)
SOCKET CreateSocket(const CService &addrConnect)
bool SetProxy(enum Network net, const proxyType &addrProxy)