Hi, +-From: Rihui Luo <[EMAIL PROTECTED]> --------- |_Date: Mon, 30 Jul 2007 16:06:04 -0700 (PDT) __ | |I have two clients, every hour each client connects to a SSH server, |transfer files, then disconnect.
Are you disconnecting the channel or session? Is the TCP connection really dropped? | Initially it works fine, but after a |couple of days, one of the clients hang. Here's the stack trace from jdb, |it seems to me that connect blocks at read indefinitely. |main[1] where | [1] java.net.SocketInputStream.socketRead0 (native method) | [2] java.net.SocketInputStream.read (null) | [3] java.net.SocketInputStream.read (null) | [4] com.jcraft.jsch.IO.getByte (null) | [5] com.jcraft.jsch.Session.connect (null) | [6] com.jcraft.jsch.Session.connect (null) It seems to me that jsch just has been waiting for the sshd's version string. I mean that, after openning the TCP socket to sshd, jsch has waited for the string; for example, "SSH-2.0-OpenSSH_4.3", but sshd has not sent it by some reason. What kind of sshd are you connecting to? IMHO, the problem is not in jsch. To work around such infinite block, you may be able to use Session#connect(int connectTimeout); and, at the timeout, how about trying the making connection again? 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/ ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users