Hi,

   +-From: Tetsuo Handa <[EMAIL PROTECTED]> --
   |_Date: Tue, 3 Jun 2008 21:27:43 +0900 __________________
   |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));
   |  }

You know that, on some JVMs which adopt the Green Thread,
the blocking I/O will block other threads, unfortunately.

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

Please refer to RFC4254, Section 5.3 "Closing a Channel"
for meanings for CLOSE and EOF.

As for usage about them in Exec.java, 
the exit-status code may not be sent even if EOF is given,
but it may be after accepting CLOSE, according to RFC4254.

[1] http://rfc.net/rfc4254.html

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to