Hi You should maybe try to ask / get the attention of the JSCH team.
I think bengt (A camel user) did that when he found an issue with using private keys and something else. So they are there. On Wed, Jul 7, 2010 at 1:13 PM, Mattias Severson <mat...@gmail.com> wrote: > > Hmm, maybe I was to hastily to reply and file the issue yesterday. It turned > out that there is also a connection timeout on the JCH > http://grepcode.com/file/repo1.maven.org/maven2/com.jcraft/jsch/0.1.42/com/jcraft/jsch/Channel.java#Channel.connect%28int%29 > Channel class, which is super class to the > http://grepcode.com/file/repo1.maven.org/maven2/com.jcraft/jsch/0.1.42/com/jcraft/jsch/ChannelSftp.java?av=f > ChannelSftp (via the > http://grepcode.com/file/repo1.maven.org/maven2/com.jcraft/jsch/0.1.42/com/jcraft/jsch/ChannelSession.java?av=f > ChannelSession class. > > That said, I have not been able to get any timeout what so ever using JSCH. > When I execute the the code below, I don't get passed the > "channel.connect(5000);" statement and it does not timeout... > > > File file = new File("toBeSent.txt"); > JSch jsch = new JSch(); > > File knownHosts = new File("/home/.ssh/known_hosts"); > jsch.setKnownHosts( knownHosts.getAbsolutePath() ); > Session session = jsch.getSession("user", "ftp.company.com"); > { > session.setPassword("secret"); > session.setPort(2222); > } > session.connect(5000); > > Channel channel = session.openChannel( "sftp" ); > channel.connect(5000); > ChannelSftp sftpChannel = (ChannelSftp) channel; > sftpChannel.put(file.getAbsolutePath(), file.getName()); > sftpChannel.exit(); > session.disconnect(); > -- > View this message in context: > http://camel.465427.n5.nabble.com/Configuration-of-connection-timeout-when-transmitting-files-to-remote-SFTP-server-tp696546p1044670.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus