mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
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:
parent
ef78f90225
commit
ad96c86f68
4 changed files with 131 additions and 29 deletions
|
@ -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
|
||||
|
|
|
@ -17,6 +17,8 @@ class ExtAddrFinder
|
|||
|
||||
void start_request() ;
|
||||
|
||||
void reset() ;
|
||||
|
||||
private:
|
||||
friend void* doExtAddrSearch(void *p) ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue