bool operator!=(const CService& a, const CService& b) { #ifdef USE_NATIVE_I2P return (CNetAddr)a != (CNetAddr)b || !(a.port == b.port || (a.IsNativeI2P() && b.IsNativeI2P())); #else return (CNetAddr)a != (CNetAddr)b || a.port != b.port; #endif }
bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout) { const proxyType &proxy = proxyInfo[addrDest.GetNetwork()]; #ifdef USE_NATIVE_I2P if (addrDest.IsNativeI2P()&&IsI2PEnabled()) { SOCKET streamSocket = I2PSession::Instance().connect(addrDest.GetI2PDestination(), false/*, streamSocket*/); if (SetSocketOptions(streamSocket)) { hSocketRet = streamSocket; return true; } return false; } #endif // no proxy needed if (!proxy.second) return ConnectSocketDirectly(addrDest, hSocketRet, nTimeout); SOCKET hSocket = INVALID_SOCKET; // first connect to proxy server if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) return false; // do socks negotiation switch (proxy.second) { case 4: if (!Socks4(addrDest, hSocket)) return false; break; case 5: if (!Socks5(addrDest.ToStringIP(), addrDest.GetPort(), hSocket)) return false; break; default: return false; } hSocketRet = hSocket; return true; }
bool operator<(const CService& a, const CService& b) { #ifdef USE_NATIVE_I2P return (CNetAddr)a < (CNetAddr)b || ((CNetAddr)a == (CNetAddr)b && (a.port < b.port) && !(a.IsNativeI2P() && b.IsNativeI2P())); #else return (CNetAddr)a < (CNetAddr)b || ((CNetAddr)a == (CNetAddr)b && a.port < b.port); #endif }
bool operator<(const CService& a, const CService& b) { return (CNetAddr)a < (CNetAddr)b || ((CNetAddr)a == (CNetAddr)b && (a.port < b.port) && !(a.IsNativeI2P() && b.IsNativeI2P())); }
bool operator!=(const CService& a, const CService& b) { return (CNetAddr)a != (CNetAddr)b || !(a.port == b.port || (a.IsNativeI2P() && b.IsNativeI2P())); }