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