how to increase the jsch buffer size? -


i using jsch sftp file transfer. when send file using sftp command setting buffer size 512 (-b option ) sftp b 512 [sftp server name] , invoking put command, can transfer files in 8.0mbps. (the regular speed 3.0mbps).

when same file transfer using jsch api in java, 2.6mbps. there option increase buffer size in jsch or improve speed of jsch?

here code...

channel channel = null; channelsftp channelsftp = null; log("preparing host information sftp."); try {     jsch jsch = new jsch();      session = jsch.getsession(username, hostname, port);     session.setpassword(password);     java.util.properties config = new java.util.properties();     config.put("stricthostkeychecking", "no");     session.setconfig(config);     session.connect();     system.out.println("host connected.");     channel = session.openchannel("sftp");     channel.connect();     log("sftp channel opened , connected.");     channelsftp = (channelsftp) channel;     channelsftp.cd(sftpworkingdir);     file f = new file(filename);     channelsftp.put(new fileinputstream(f), f.getname());     log("file transferred host."); } catch (exception ex) {      system.out.println("exception found while transfer response.");      ex.printstacktrace(); } finally{      channelsftp.exit();     log("sftp channel exited.");     channel.disconnect();     log("channel disconnected.");     session.disconnect();     log("host session disconnected."); } 

check out newer version of jsch (1.50), became faster downloading.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -