Reworking of networking code to enable Net Restart.

* Stun code now runs continually - to check external network state.
  * Udpsorter controls DHT stun is on/off. (via p3ConnectMgr)
  * added code to enable threads to join/restart 
  * enabled NetRestart for UDP and TCP.
  * tweaked networking code for faster startup (now ~30 seconds - can still be improved).
  * tweaked debug messages for testing networking
  * Added test for checking external IP address determination.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1492 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2009-08-04 23:22:44 +00:00
parent d5581629ef
commit 2bf94b909a
22 changed files with 774 additions and 81 deletions

View file

@ -70,9 +70,12 @@ class UdpLayer: public RsThread
UdpLayer(UdpReceiver *recv, struct sockaddr_in &local);
virtual ~UdpLayer() { return; }
int reset(struct sockaddr_in &local); /* calls join, close, openSocket */
int status(std::ostream &out);
/* setup connections */
int close();
int openSocket();
/* RsThread functions */
@ -88,7 +91,6 @@ void recv_loop(); /* uses callback to UdpReceiver */
int okay();
int tick();
int close();
/* data */
/* internals */
@ -110,6 +112,7 @@ virtual int sendUdpPacket(const void *data, int size, struct sockaddr_in &to);
int errorState;
int sockfd;
int ttl;
bool stopThread;
RsMutex sockMtx;
};