/** * This is how the client connects. * * @param port > 0 */ static void internalConnect(int port, InternalSocket clientSock) throws IOException { InternalServerSocket iss = _sockets.get(Integer.valueOf(port)); if (iss == null) throw new IOException("No server for port: " + port); TimeoutPipedInputStream cis = new TimeoutPipedInputStream(64*1024); TimeoutPipedInputStream sis = new TimeoutPipedInputStream(64*1024); PipedOutputStream cos = new TimeoutPipedOutputStream(sis); PipedOutputStream sos = new TimeoutPipedOutputStream(cis); clientSock.setInputStream(cis); clientSock.setOutputStream(cos); iss.queueConnection(new InternalSocket(sis, sos)); }