[JSch-users] ScpTo flushing the outstream while copying
Status: Alpha
Brought to you by:
ymnk
From: Prakash B. <jpr...@gm...> - 2013-04-20 15:05:22
|
Hi, I am using the scpTo example @ http://www.jcraft.com/jsch/examples/ScpTo.java ================================================== // send a content of lfile fis=new FileInputStream(lfile); byte[] buf=new byte[1024]; while(true){ int len=fis.read(buf, 0, buf.length); if(len<=0) break; out.write(buf, 0, len); //out.flush(); } fis.close(); fis=null; // send '\0' buf[0]=0; out.write(buf, 0, 1); out.flush(); if(checkAck(in)!=0){ System.exit(0); } out.close(); ================================== I am facing intermittent hang while copying when I uncomment it out.flush in the while loop. So just want to know the reason why its commented ? thanks, Prakash |