Hi Atsuhiko,

thanks for your reply.
Will the following code snippet help me to detect all scenarios where the sshd 
on the target is not responding(My netstat output says tcp connection 
"ESTABLISHED").
As per your reply the 'Session#setSocketFactory(SocketFactory sfactory)'  
should also be called. Why is this required ?

        Session session = null;
        try
        {
            JSch jsch=new JSch();
            session=jsch.getSession(m_user, m_host, m_port);
            session.setUserInfo(ui);
            session.connect(60000);
            session.disconnect();
        }
        catch(Exception e)
        {
            e.printStackTrace();
          
        }

thanks,
Prakash

   +-From: prakash babu <jprakashb...@yahoo.co.in> --
   |_Date: Mon, 19 Sep 2011 16:04:31 +0530 (IST) ____
   |
   |Questions.
   |i. Is there a way to terminate this TCP connection without terminating
   |my web application ?
   |ii. Is there a reliable way to detect these fault hosts which accept 
   |the connection but does not respond ?

How about using
  Session#connect(int timeout), 
  Session#disconnect()
and
  Session#setSocketFactory(SocketFactory sfactory)


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
Skype callto://jcraft/
Twitter: http://twitter.com/ymnk
Facebook: http://facebook.com/aymnk


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to