5 #ifndef FABCOIN_NETBASE_H 6 #define FABCOIN_NETBASE_H 8 #if defined(HAVE_CONFIG_H) 24 static const int DEFAULT_CONNECT_TIMEOUT = 5000;
26 static const int DEFAULT_NAME_LOOKUP =
true;
47 bool LookupHost(
const char *pszName, std::vector<CNetAddr>& vIP,
unsigned int nMaxSolutions,
bool fAllowLookup);
49 bool Lookup(
const char *pszName,
CService& addr,
int portDefault,
bool fAllowLookup);
50 bool Lookup(
const char *pszName, std::vector<CService>& vAddr,
int portDefault,
bool fAllowLookup,
unsigned int nMaxSolutions);
69 #endif // FABCOIN_NETBASE_H bool CloseSocket(SOCKET &hSocket)
Close socket and set hSocket to INVALID_SOCKET.
bool SetProxy(enum Network net, const proxyType &addrProxy)
bool SetSocketNonBlocking(const SOCKET &hSocket, bool fNonBlocking)
Disable or enable blocking-mode for a socket.
bool SetSocketNoDelay(const SOCKET &hSocket)
Set the TCP_NODELAY flag on a socket.
bool ConnectSocket(const CService &addr, SOCKET &hSocketRet, int nTimeout, bool *outProxyConnectionFailed=0)
enum Network ParseNetwork(std::string net)
proxyType(const CService &_proxy, bool _randomize_credentials=false)
void InterruptSocks5(bool interrupt)
bool Lookup(const char *pszName, CService &addr, int portDefault, bool fAllowLookup)
struct timeval MillisToTimeval(int64_t nTimeout)
Convert milliseconds to a struct timeval for e.g.
bool LookupSubNet(const char *pszName, CSubNet &subnet)
bool ConnectSocketByName(CService &addr, SOCKET &hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed=0)
bool IsProxy(const CNetAddr &addr)
bool randomize_credentials
bool LookupHost(const char *pszName, std::vector< CNetAddr > &vIP, unsigned int nMaxSolutions, bool fAllowLookup)
A combination of a network address (CNetAddr) and a (TCP) port.
bool SetNameProxy(const proxyType &addrProxy)
CService LookupNumeric(const char *pszName, int portDefault=0)
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
std::string GetNetworkName(enum Network net)
std::string NetworkErrorString(int err)
Return readable error string for a network error code.
bool GetProxy(enum Network net, proxyType &proxyInfoOut)