From 3db8b63cdee93a52d683324214ef0c89d8b0d193 Mon Sep 17 00:00:00 2001 From: jrandom Date: Tue, 4 May 2004 08:16:41 +0000 Subject: [PATCH] by default, set the readTimeout to 3 minutes, NOT infinity. Overridable as before (setting the timeout to -1) add a unique id to the server thread --- .../java/src/net/i2p/i2ptunnel/I2PTunnelServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java index a219b4e40..03d4290c4 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java @@ -40,7 +40,8 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { private Logging l; - private long readTimeout = -1; + /** default timeout to 3 minutes - override if desired */ + private long readTimeout = 3*60*1000; public I2PTunnelServer(InetAddress host, int port, String privData, Logging l, EventDispatcher notifyThis) { super(host + ":" + port + " <- " + privData, notifyThis); @@ -81,13 +82,16 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { open = true; } + + private static volatile long __serverId = 0; + /** * Start running the I2PTunnelServer. * */ public void startRunning() { Thread t = new I2PThread(this); - t.setName("Server"); + t.setName("Server " + (++__serverId)); t.start(); }