execChannel.setCommand(cmd);
execChannel.connect(timeOut);
while (!execChannel.isClosed()) {
TimeUnit.MILLISECONDS.sleep(100);
}
I used to running cp xxx xxx,the file size is 13G,it takes serveral minutes to finish.but sometimes execChannel.isClosed() always return false and execChannel.getExitStatus() always return -1. So this code can't break out the loop.but on the server, cp process is finish and the server doesn't have this process.
So i guess it may because of long command, or channel doesn't receive end message from the server. But not happens every time.
Jsch version is 0.1.55.How to fix it?