0

我正在使用来自 ganymed-ssh2-build210.jar 的 ch.ethz.ssh2.Connection.Connection 对象

我想在建立与服务器的连接时添加超时,这样如果它无法打开连接,在一定时间后它应该抛出一些异常。任何人都可以帮助如何在使用连接方法建立连接时添加超时?

在此先感谢,德瓦亚尼

4

1 回答 1

2

连接方法之一有一个超时参数:http ://www.cleondris.ch/opensource/ssh2/javadoc/ch/ethz/ssh2/Connection.html#connect(ch.ethz.ssh2.ServerHostKeyVerifier,%20int ,%20int)

于 2011-06-06T17:27:29.523 回答