Hi, 

   I use JSCH to implement a SFTP client,  all work well except one
problem:  If the method "ChannelSftp.disconnect()" is not called,
process will hang when stopping. 

   In normal exit case, that method could be called;  But if  process
exits in a abnormal way, and that method can not be called, I am afraid
that the hang problem will occur. 

   So I want to know whether there is some method in JSCH to set
"TIMEOUT" for a sftp session, once reaching the time, corresponding
session and sftpchannel will close automatically.

   My use-case: 
   JSch jsch=new JSch();
   Session session=jsch.getSession("XXX", "XXX", 22);
   UserInfo ui=new MyUserInfo();
   session.setUserInfo(ui);
   session.connect();
   Channel channel=session.openChannel("sftp");
   channel.connect();
   ChannelSftp channel=(ChannelSftp)channel;
   //do some file transfer using channel
   ...

   //when shutting down process
   channel.disconnect();
   session.disconnect();

   Thanks.

Regards,
Atlantis
------------------------------------------------------------------------------
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to