2009-04-03 05:21:58 -04:00
|
|
|
#pragma once
|
|
|
|
|
2009-04-05 09:04:18 -04:00
|
|
|
#include <list>
|
|
|
|
#include <string>
|
2009-04-03 05:21:58 -04:00
|
|
|
#include "util/rsthreads.h"
|
2013-09-13 10:35:19 -04:00
|
|
|
#include "util/rsnet.h"
|
2009-04-03 05:21:58 -04:00
|
|
|
|
|
|
|
struct sockaddr ;
|
|
|
|
|
|
|
|
class ExtAddrFinder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ExtAddrFinder() ;
|
|
|
|
~ExtAddrFinder() ;
|
|
|
|
|
2013-09-13 10:35:19 -04:00
|
|
|
bool hasValidIP(struct sockaddr_storage &addr) ;
|
2009-04-05 09:04:18 -04:00
|
|
|
void getIPServersList(std::list<std::string>& ip_servers) { ip_servers = _ip_servers ; }
|
2009-04-03 05:21:58 -04:00
|
|
|
|
|
|
|
void start_request() ;
|
|
|
|
|
2009-11-06 17:12:58 -05:00
|
|
|
void reset() ;
|
|
|
|
|
2009-04-05 09:04:18 -04:00
|
|
|
private:
|
|
|
|
friend void* doExtAddrSearch(void *p) ;
|
|
|
|
|
2013-09-13 10:35:19 -04:00
|
|
|
RsMutex mAddrMtx ;
|
|
|
|
time_t mFoundTS;
|
|
|
|
struct sockaddr_storage mAddr;
|
|
|
|
bool mFound ;
|
|
|
|
bool mSearching ;
|
2009-04-05 09:04:18 -04:00
|
|
|
std::list<std::string> _ip_servers ;
|
2009-04-03 05:21:58 -04:00
|
|
|
};
|