6 #ifndef RAVEN_NETBASE_H 7 #define RAVEN_NETBASE_H 9 #if defined(HAVE_CONFIG_H) 25 static const int DEFAULT_CONNECT_TIMEOUT = 5000;
27 static const int DEFAULT_NAME_LOOKUP =
true;
49 bool LookupHost(
const char *pszName, std::vector<CNetAddr>& vIP,
unsigned int nMaxSolutions,
bool fAllowLookup);
51 bool Lookup(
const char *pszName,
CService& addr,
int portDefault,
bool fAllowLookup);
52 bool Lookup(
const char *pszName, std::vector<CService>& vAddr,
int portDefault,
bool fAllowLookup,
unsigned int nMaxSolutions);
71 #endif // RAVEN_NETBASE_H bool ConnectThroughProxy(const proxyType &proxy, const std::string &strDest, int port, SOCKET &hSocketRet, int nTimeout, bool *outProxyConnectionFailed)
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.
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 IsProxy(const CNetAddr &addr)
bool randomize_credentials
bool LookupHost(const char *pszName, std::vector< CNetAddr > &vIP, unsigned int nMaxSolutions, bool fAllowLookup)
bool ConnectSocketDirectly(const CService &addrConnect, SOCKET &hSocketRet, int nTimeout)
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)
bool GetNameProxy(proxyType &nameProxyOut)