Try out some of SoftwareElves' suggestions for faster startup connections

This commit is contained in:
Charles Kerr
2007-10-11 02:50:05 +00:00
parent ead1ff5b72
commit ef4ec75532
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -24,6 +24,8 @@
#include "trevent.h"
#include "utils.h"
#define IO_TIMEOUT_SECS 8
/**
***
**/
@@ -136,6 +138,7 @@ tr_peerIoNew( struct tr_handle * handle,
didWriteWrapper,
gotErrorWrapper,
c );
bufferevent_settimeout( c->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS );
bufferevent_enable( c->bufev, EV_READ|EV_WRITE );
return c;
}
@@ -275,6 +278,7 @@ tr_peerIoReconnect( tr_peerIo * io )
didWriteWrapper,
gotErrorWrapper,
io );
bufferevent_settimeout( io->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS );
bufferevent_enable( io->bufev, EV_READ|EV_WRITE );
return 0;
+1 -1
View File
@@ -64,7 +64,7 @@ enum
/* set this too high and there will be a lot of churn.
* set it too low and you'll get peers too slowly */
MAX_RECONNECTIONS_PER_PULSE = 8,
MAX_RECONNECTIONS_PER_PULSE = 10,
/* corresponds to ut_pex's added.f flags */
ADDED_F_ENCRYPTION_FLAG = 1,