Hi,

   +-From: Boris Klug <[email protected]> --
   |_Date: Fri, 06 Aug 2010 15:22:41 +0200 ____
   |
   |The only problem we have is a performance issue: When you execute
   |a command on Unix using the ChannelExcec which generates a big
   |output and you read these output, it takes a long time.  E.g. a
   |"cat filename" for a 5 mb file takes about 17 seconds.  When you
   |transfer the same file with sftp (ChannelSftp), the transfer takes
   |under 1 second.

I have tried them, but I have not found such a long delay 
with using ChannelExec.
Is it possible to show me your code to get the result from "cat filename"?
Here is a chunk of my code for "cat filename",

  ...
  Channel channel = null;
  channel=session.openChannel("exec");
  ((ChannelExec)channel).setCommand( "cat filename" );
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  channel.setOutputStream( baos );
  long start = System.currentTimeMillis();
  channel.connect();
  while(true){
    if(channel.isClosed()){
      break;
    }
    try{Thread.sleep( 10 );}catch(Exception ee){}
  }
  System.out.println(System.currentTimeMillis() - start);
  System.out.println(baos.size());
  channel.disconnect();

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
Skype callto://jcraft/
Twitter: @ymnk

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to