Hello.

Atsuhiko Yamanaka wrote:
> You know that, on some JVMs which adopt the Green Thread,
> the blocking I/O will block other threads, unfortunately.
Oh, I didn't know that. Exec.java calls Thread.sleep(1000); to avoid
blocking other threads while current thread is blocked at InputStream.read().

Then, regarding JVMs where InputStream.read() doesn't block other threads,
it is OK to call like
  while(true) {
    int i = in.read(tmp, 0, 1024);
    if(i < 0) break;
    System.out.print(new String(tmp, 0, i));
  }
for simplicity, isn't it? (Please mention if I'm wrong.)
But, from the point of view of portability, such coding should be avoided.

> 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
So, I had better not to call channel.getExitStatus() before
channel.isClosed() returns true. I see.

Thank you.

-------------------------------------------------------------------------
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