mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 08:07:31 -04:00
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:
parent
dddc9c383c
commit
40f4009ca7
10 changed files with 328 additions and 53 deletions
libretroshare/src/util
31
libretroshare/src/util/extaddrfinder.h
Normal file
31
libretroshare/src/util/extaddrfinder.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include "util/rsthreads.h"
|
||||
|
||||
struct sockaddr ;
|
||||
|
||||
class ExtAddrFinder
|
||||
{
|
||||
public:
|
||||
ExtAddrFinder() ;
|
||||
~ExtAddrFinder() ;
|
||||
|
||||
bool hasValidIP(struct in_addr *addr) ;
|
||||
void getIPServersList(std::list<std::string>& ip_servers) { ip_servers = _ip_servers ; }
|
||||
|
||||
void start_request() ;
|
||||
|
||||
void reset() ;
|
||||
|
||||
private:
|
||||
friend void* doExtAddrSearch(void *p) ;
|
||||
|
||||
time_t *mFoundTS;
|
||||
RsMutex _addrMtx ;
|
||||
struct in_addr *_addr ;
|
||||
bool *_found ;
|
||||
bool *_searching ;
|
||||
std::list<std::string> _ip_servers ;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue