Dear Atsuhiko,

I did 2 additional tests that you proposed.
I'm not sure what to test next.

■ test1: use InputStream#read() instead of Channel#setOutputStream()
 The problem happened.
 It seems that in.available() keeps 0.

 (1) source
    ...
    Channel channel = null;
    channel=thisSession.openChannel("exec");
    ((ChannelExec)channel).setCommand( "ls -la" );
    ( (ChannelExec)channel ).setPty( true );

    //  ByteArrayOutputStream baos = new ByteArrayOutputStream();
    //  channel.setOutputStream( baos );

    InputStream in=channel.getInputStream();

    long start = System.currentTimeMillis();
    channel.connect();
    byte[] tmp=new byte[1024];
    while(true){
      long end = System.currentTimeMillis();

      int readBytes = 0;
      if(in.available()>0){
        readBytes = in.read(tmp, 0, tmp.length);
      }
      ...
      if( ( end - start ) > 30000 ){
        System.out.println( (end-start) + "ms, more than 30sec,"
                            + " readBytes = " + readBytes +", break");
        canContinue = false;
        break;
      }
      ...

 (2) Network
       Client( jsch ) → HUB → SSHD

 (3) result
     [0] 2010-01-19 13:09:28.68........., average=72ms
          ..
     [0] 2010-01-19 13:25:33.112........., average=72ms
     [0] 2010-01-19 13:25:40.344........30006ms, more than 30sec, readBytes = 
0, break

■ test2: continue after problem
          ( comment out "canContinue = false;" )

 The problem happened.
 And "ps ax | grep sshd | grep notty | wc" is still same.

[r...@rcm26 ~]# ps ax | grep sshd | grep notty | wc
    102     612    4790
[0] 2010-01-19 17:16:48.179........., average=72ms30002ms, more than 30sec, not 
break
........., average=71ms
[0] 2010-01-19 17:17:32.582........., average=72ms
[r...@rcm26 ~]# ps ax | grep sshd | grep notty | wc
    102     612    4790

Sincerely,
----------------------------------
Yukimasa Matsuda
  Quatre-i Science Co., Ltd.
    e-mail: mats...@i4s.co.jp
    http://www.i4s.co.jp
----------------------------------


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to