Thanks for explaining Atsuhiko.

It sounds like it's worth trying this option. Although it can't "wake up" a frozen connection it might prevent the situation to happen in the first place.

More questions...

Does Jsch also support TCPKeepAlive? I did the "man ssh_config" and ssh seems to use TCPKeepAlive by default. I'm not sure I completely understand the difference between the two but after doing some googling it seems that TCPKeepAlive is mainly used to detect lost peers (and then disconnect and start all over I guess) while ServerAliveInterval is used to actually keep the connection alive so that the remote end doesn't assume that we are gone.

Is that correct? If so, it seems I should probably use both TCPKeepAlive and ServerAliveInterval. How can I enable TCPKeepAlive?


2012/10/3 Atsuhiko Yamanaka <>

   +-From: Bengt Rodehav <> --
   |_Date: Wed, 3 Oct 2012 09:31:24 +0200 _____
   |                                                             I will try to
   |upgrade the Jsch version but I've also read about "setServerAliveInterval".
   |It seems like Camel now supports this property. In addition, there also
   |seems to be a "serverAliveCountMax" property.

Session#setServerAliveInterval() sets a timeout interval in milliseconds
after which if no data has been received from the server, a message will
be sent through the encrypted channel to request a response from the server.
OpenSSH has similar configurations, "ServerAliveInterval" and
"ServerAliveCountMax".  Refer to "man ssh_config".

   |Can someone explain to me what these properties do? Can they be used to
   |"wake up" an sftp connection that is frozen and thus increase the stability
   |of sftp polling?

It will not "wake up" a frozen sftp connection,
but it will not let a sftp connection sleep.

Atsuhiko Yamanaka
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
Skype callto://jcraft/