made the DNS calls in a separate thread, using new DNSResolver class. Added test program for that class as well. Moved extaddrfinder to util/

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3980 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-01-24 22:05:10 +00:00
parent dddc9c383c
commit 40f4009ca7
10 changed files with 328 additions and 53 deletions
libretroshare/src/util

View file

@ -129,22 +129,6 @@ bool isExternalNet(const struct in_addr *addr)
return true;
}
bool getIPAddressFromString (const char *addr_str, struct in_addr *addr)
{
if (addr_str && addr) {
static RsMutex mtx;
RsStackMutex stack(mtx);
hostent *pHost = gethostbyname (addr_str);
if (pHost) {
addr->s_addr = *(unsigned long*) (pHost->h_addr);
return true;
}
}
return false;
}
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
{
out << "[" << inet_ntoa(addr.sin_addr) << ":";