Hello.

I'm trying to run shell commands via jsch.
In the example at http://www.jcraft.com/jsch/examples/Exec.java
I can see Thread.sleep(1000); within an infinite loop.

Isn't the InputStream.read() blocking operation?
Why can't we do simply like

  while(true) {
    int i = in.read(tmp, 0, 1024);
    if(i < 0) break;
    System.out.print(new String(tmp, 0, i));
  }

And what's the difference between
channel.isClosed() and channel.isEOF() ?

Regards.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to