diff --git a/core/java/src/net/i2p/util/InternalServerSocket.java b/core/java/src/net/i2p/util/InternalServerSocket.java index 8e88afc5c..c7638a689 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 _sockets = new ConcurrentHashMap(4); - private BlockingQueue _acceptQueue; - private Integer _port; + private final BlockingQueue _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 1d94d9694..3a0695274 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 &&