Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用来自 ganymed-ssh2-build210.jar 的 ch.ethz.ssh2.Connection.Connection 对象
我想在建立与服务器的连接时添加超时,这样如果它无法打开连接,在一定时间后它应该抛出一些异常。任何人都可以帮助如何在使用连接方法建立连接时添加超时?
在此先感谢,德瓦亚尼
连接方法之一有一个超时参数:http ://www.cleondris.ch/opensource/ssh2/javadoc/ch/ethz/ssh2/Connection.html#connect(ch.ethz.ssh2.ServerHostKeyVerifier,%20int ,%20int)