forked from I2P_Developers/i2p.i2p
2004-12-30 jrandom
* Revised the I2PTunnel client and httpclient connection establishment throttles. There is now a pool of threads that build the I2PSocket connections with a default size of 5, configurable via the I2PTunnel client option 'i2ptunnel.numConnectionBuilders' (if set to 0, it will not throttle the number of concurrent builders, but will launch a thread per socket during establishment). In addition, sockets accepted but not yet allocated to one of the connection builders will be destroyed after 30 seconds, configurable via 'i2ptunnel.maxWaitTime' (if set to 0, it will wait indefinitely).
This commit is contained in:
@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.125 $ $Date: 2004/12/29 15:06:44 $";
|
||||
public final static String ID = "$Revision: 1.126 $ $Date: 2004/12/29 17:16:42 $";
|
||||
public final static String VERSION = "0.4.2.5";
|
||||
public final static long BUILD = 3;
|
||||
public final static long BUILD = 4;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@@ -163,11 +163,14 @@ class ConnectionRunner implements Runnable {
|
||||
long timeSinceWrite = _context.clock().now() - _lastWrite;
|
||||
if (timeSinceWrite > 5*TIME_SEND_FREQUENCY) {
|
||||
TCPTransport t = _con.getTransport();
|
||||
t.addConnectionErrorMessage("Connection closed with "
|
||||
+ _con.getRemoteRouterIdentity().getHash().toBase64().substring(0,6)
|
||||
+ " due to " + DataHelper.formatDuration(timeSinceWrite)
|
||||
+ " of inactivity after "
|
||||
+ DataHelper.formatDuration(_con.getLifetime()));
|
||||
String msg = "Connection closed with "
|
||||
+ _con.getRemoteRouterIdentity().getHash().toBase64().substring(0,6)
|
||||
+ " due to " + DataHelper.formatDuration(timeSinceWrite)
|
||||
+ " of inactivity after "
|
||||
+ DataHelper.formatDuration(_con.getLifetime());
|
||||
t.addConnectionErrorMessage(msg);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(msg);
|
||||
_con.closeConnection(false);
|
||||
return;
|
||||
}
|
||||
@@ -187,5 +190,7 @@ class ConnectionRunner implements Runnable {
|
||||
msg.setMessage(buildTimeMessage());
|
||||
msg.setPriority(100);
|
||||
_con.addMessage(msg);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Enqueueing time message to " + _con.getRemoteRouterIdentity().getHash().toBase64().substring(0,6));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user