Hi,

In my web application i need to use sftp to transfer a zip file. I connect to the sftp like this:


....
session.connect();
Channel channel=session.openChannel("sftp");
channel.connect();
...


The first time i connect all is correct, i connect and i tranfer the file. But the secong time i try to execute the code without shuting down the server, when it arrives to the channel.connect() it stop forever.


I think it maybe cause i don't close properly the session or the channel, the code i use for closing all is:


channel.exit();
channel.quit();
channel.disconnect();
session.disconnect();


Can someone helps me?


Thanks