@Override public void handleConnection( InputStream clientIn, OutputStream clientOut, InputStream serverIn, OutputStream serverOut, InetSocketAddress clientLocalSocketAddress, InetSocketAddress clientRemoteSocketAddress, InetSocketAddress serverLocalSocketAddress, InetSocketAddress serverRemoteSocketAddress, Stoppable stoppable ) throws IOException { ThreadUtil.parallel( IoUtil.copyRunnable(clientIn, serverOut), IoUtil.copyRunnable(serverIn, clientOut), stoppable ); } }
@Override public void handleConnection( InputStream clientIn, OutputStream clientOut, InputStream serverIn, OutputStream serverOut, InetSocketAddress clientLocalSocketAddress, InetSocketAddress clientRemoteSocketAddress, InetSocketAddress serverLocalSocketAddress, InetSocketAddress serverRemoteSocketAddress, Stoppable stoppable ) throws IOException { ThreadUtil.parallel( IoUtil.copyRunnable(clientIn, serverOut), IoUtil.copyRunnable(serverIn, clientOut), stoppable ); } }
ThreadUtil.runInBackground(IoUtil.copyRunnable(socketInputStream, System.out), null); ThreadUtil.runInForeground(IoUtil.copyRunnable(System.in, socketOutputStream));
ThreadUtil.runInBackground(IoUtil.copyRunnable(socketInputStream, System.out), null); ThreadUtil.runInForeground(IoUtil.copyRunnable(System.in, socketOutputStream));
@Override public void handleConnection( InputStream clientIn, OutputStream clientOut, InputStream serverIn, OutputStream serverOut, InetSocketAddress clientLocalSocketAddress, InetSocketAddress clientRemoteSocketAddress, InetSocketAddress serverLocalSocketAddress, InetSocketAddress serverRemoteSocketAddress, Stoppable stoppable ) throws IOException { ThreadUtil.parallel( IoUtil.copyRunnable(clientIn, OutputStreams.tee( serverOut, new HexOutputStream(LogUtil.logWriter(LOGGER, FINER, "> ")) )), IoUtil.copyRunnable(serverIn, OutputStreams.tee( clientOut, new HexOutputStream(LogUtil.logWriter(LOGGER, FINER, "< ")) )), stoppable ); } }
@Override public void handleConnection( InputStream clientIn, OutputStream clientOut, InputStream serverIn, OutputStream serverOut, InetSocketAddress clientLocalSocketAddress, InetSocketAddress clientRemoteSocketAddress, InetSocketAddress serverLocalSocketAddress, InetSocketAddress serverRemoteSocketAddress, Stoppable stoppable ) throws IOException { ThreadUtil.parallel( IoUtil.copyRunnable(clientIn, IoUtil.tee( serverOut, new HexOutputStream(LogUtil.logWriter(LOGGER, FINER, "> ")) )), IoUtil.copyRunnable(serverIn, IoUtil.tee( clientOut, new HexOutputStream(LogUtil.logWriter(LOGGER, FINER, "< ")) )), stoppable ); } }