Added dynamic local and external ip reconfiguration. I still need to reset connexions when changing ips.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1796 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-11-06 22:12:58 +00:00
parent ef78f90225
commit ad96c86f68
4 changed files with 131 additions and 29 deletions

View file

@ -231,12 +231,28 @@ bool ExtAddrFinder::hasValidIP(struct sockaddr_in *addr)
return *_found ;
}
void ExtAddrFinder::reset()
{
while(*_searching)
#ifdef WIN32
Sleep(1000) ;
#else
sleep(1) ;
#endif
RsStackMutex mut(_addrMtx) ;
*_found = false ;
*_searching = false ;
*mFoundTS = time(NULL) - MAX_IP_STORE;
}
ExtAddrFinder::~ExtAddrFinder()
{
#ifdef EXTADDRSEARCH_DEBUG
std::cerr << "ExtAddrFinder: Deleting ExtAddrFinder." << std::endl ;
#endif
while(!*_searching)
while(*_searching)
#ifdef WIN32
Sleep(1000) ;
#else

View file

@ -17,6 +17,8 @@ class ExtAddrFinder
void start_request() ;
void reset() ;
private:
friend void* doExtAddrSearch(void *p) ;