Significant changes to aid UDP connections.

* Added Period and Delay parameters to connections.
   - Delay is used to avoid simultaneous TCP connections.
   - Period is used to regulate UDP connections.
 * added Delay code to pqissl.
 * added Period code to tcponudp / pqissludp.
 * modified TTL modification code.
 * increased SynPktRetransmit value.
 * fixed retrans() timeout (one reason code wasn't working before!)
 * fixed tou_close() SEGV bug.
 * modified pqissludp tou_socket creation. (non permanent now).
 * Modified format of peerConnectRequest() CB to make it more useful and rewrote function.
 * Enabled pqissludp NetInterface.
 * using Id comparision to determine Active/Passive UDP connection state.
 * added #def to disable TCP connections. (for testing)
 * enabled UDP connections from retryConnect() function.
 * corrected EXT check in retryConnect() function.
 * + lots of debug output and other stuff.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@358 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-02-27 02:32:20 +00:00
parent e87b7b75e7
commit 8b230a55cf
24 changed files with 381 additions and 87 deletions

View file

@ -166,7 +166,7 @@ int tou_bind(int sockfd, const struct sockaddr *my_addr,
* - always non blocking.
*/
int tou_connect(int sockfd, const struct sockaddr *serv_addr,
socklen_t addrlen)
socklen_t addrlen, uint32_t conn_period)
{
if (tou_streams[sockfd] == NULL)
{
@ -189,7 +189,7 @@ int tou_connect(int sockfd, const struct sockaddr *serv_addr,
*((const struct sockaddr_in *) serv_addr));
}
tous->tcp->connect(*(const struct sockaddr_in *) serv_addr);
tous->tcp->connect(*(const struct sockaddr_in *) serv_addr, conn_period);
tous->tcp->tick();
tou_tick_all();
if (tous->tcp->isConnected())
@ -377,12 +377,17 @@ int tou_close(int sockfd)
}
TcpOnUdp *tous = tou_streams[sockfd];
tous->tcp->tick();
tou_tick_all();
/* shut it down */
tous->tcp->close();
delete tous->tcp;
if (tous->tcp)
{
tous->tcp->tick();
/* shut it down */
tous->tcp->close();
delete tous->tcp;
}
delete tous;
tou_streams[sockfd] = NULL;
return 1;