net: Split resolving out of CService

This commit is contained in:
Cory Fields
2016-05-31 13:51:11 -04:00
parent 31d6b1d5f0
commit f96c7c4d91
9 changed files with 94 additions and 101 deletions

View File

@@ -639,7 +639,7 @@ bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest
}
}
addr = CService("0.0.0.0:0");
addr = CService();
if (!HaveNameProxy())
return false;
@@ -1124,38 +1124,6 @@ bool CService::SetSockAddr(const struct sockaddr *paddr)
}
}
CService::CService(const char *pszIpPort)
{
Init();
CService ip;
if (Lookup(pszIpPort, ip, 0, false))
*this = ip;
}
CService::CService(const char *pszIpPort, int portDefault)
{
Init();
CService ip;
if (Lookup(pszIpPort, ip, portDefault, false))
*this = ip;
}
CService::CService(const std::string &strIpPort)
{
Init();
CService ip;
if (Lookup(strIpPort.c_str(), ip, 0, false))
*this = ip;
}
CService::CService(const std::string &strIpPort, int portDefault)
{
Init();
CService ip;
if (Lookup(strIpPort.c_str(), ip, portDefault, false))
*this = ip;
}
unsigned short CService::GetPort() const
{
return port;