Hi,

Thank you for your feedback,

   +-From: "Daniel McLean" <pub...@danielmclean.id.au> --
   |_Date: Thu, 14 May 2009 11:38:22 +1000 ______________
   |
   |It seems that at the very least Channel.io should be checked prior to  
   |use, however there is probably a race condition here requiring some  
   |form of synchronization between checking io and io.in.

Even if checking io in synchronizaion is done, nothing will be changed.

   |Interestingly, if I invoke:
   |  channel.connect();
   |instead of
   |  channel.connect(30000);

It seems that the channel establishment has been failed due to the timeout.
'channel.connect()' or some retries of 'channel.connect(30000)'; 

     int retry=10;
     whle(retry-- >0){
       try{
         channel = session.openChannel("exec");
         ...
         channel.connect(30000); 
         break;
       }
       catch(JSchException e){}
     }
     if(retry==0){throw new Execption("failed");}

     StringBuilder outputBuf = new StringBuilder();
     ...

will be the solution for your problem.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to