diff --git a/core/java/src/net/i2p/util/InternalServerSocket.java b/core/java/src/net/i2p/util/InternalServerSocket.java index 8e88afc5cddfeb06e38df75be0e5b404e50c2702..c7638a689979e20ff40c6db5d49208430a14436f 100644 --- a/core/java/src/net/i2p/util/InternalServerSocket.java +++ b/core/java/src/net/i2p/util/InternalServerSocket.java @@ -30,11 +30,14 @@ import net.i2p.I2PAppContext; */ public class InternalServerSocket extends ServerSocket { private static final ConcurrentHashMap<Integer, InternalServerSocket> _sockets = new ConcurrentHashMap(4); - private BlockingQueue<InternalSocket> _acceptQueue; - private Integer _port; + private final BlockingQueue<InternalSocket> _acceptQueue; + private final Integer _port; private boolean _running; //private static Log _log = I2PAppContext.getGlobalContext().logManager().getLog(InternalServerSocket.class); + /** + * @param port > 0 + */ public InternalServerSocket(int port) throws IOException { if (port <= 0) throw new IOException("Bad port: " + port); @@ -89,11 +92,7 @@ public class InternalServerSocket extends ServerSocket { /** * This is how the client connects. * - * Todo: Java 1.5 PipedInputStream buffers are only 1024 bytes; our I2CP messages are typically 1730 bytes, - * thus causing thread blockage before the whole message is transferred. - * We can specify buffer size in 1.6 but not in 1.5. - * Does wrapping the PipedOutputStreams in BufferedOutputStreams gain capacity? - * No? + * @param port > 0 */ static void internalConnect(int port, InternalSocket clientSock) throws IOException { InternalServerSocket iss = _sockets.get(Integer.valueOf(port)); diff --git a/core/java/src/net/i2p/util/InternalSocket.java b/core/java/src/net/i2p/util/InternalSocket.java index 1d94d96945715cf24737f96acd338bb53b6ab646..3a06952743569124f403e4f8b2714b5d091494bf 100644 --- a/core/java/src/net/i2p/util/InternalSocket.java +++ b/core/java/src/net/i2p/util/InternalSocket.java @@ -24,7 +24,10 @@ public class InternalSocket extends Socket { _os = os; } - /** client side */ + /** + * client side + * @param port > 0 + */ public InternalSocket(int port) throws IOException { if (port <= 0) throw new IOException("bad port number"); @@ -33,6 +36,7 @@ public class InternalSocket extends Socket { /** * Convenience method to return either a Socket or an InternalSocket + * @param port > 0 */ public static Socket getSocket(String host, int port) throws IOException { if (System.getProperty("router.version") != null &&