How to add timeout while opening SSH session (using ganymed-ssh2-build210.jar)?
I am using ch.ethz.ssh2.Connection.Connection object from ganymed-ssh2-build210.jar
I want to add timeout while establishi开发者_如何学Gong connection to server so that if it fails to open connection, after certain time it should throw some exception.Can anyone help on how to add timeout while establishing connection using connect method?
Thanks in advance, Devayani
There is a timeout parameter to one of the connect methods: http://www.cleondris.ch/opensource/ssh2/javadoc/ch/ethz/ssh2/Connection.html#connect(ch.ethz.ssh2.ServerHostKeyVerifier,%20int,%20int)
精彩评论