You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Big fan of this project, works very good in general, however one thing I found painfully missing when working with it is the possibility to set a custom value for the connection timeout. The wrapped upstream library JSch allows this principally, but unfortunately as far as I can tell not as a configuration map option, but only by directly manipulating the session object like this:
session.connect(intconnectTimeout)
Or probably better like this:
session.setTimeout(inttimeout)
To my understanding it is atm not possible to make sshoogr set this timeout parameter in clean fashion. You actually expose the session object inside the session delegate which is quite nice, but unfortunately doesn't help here as for setting the timeout to be meaningful it must obviously happen between the time frame of the session object being created and connect method being called on it, which is atm a "solid, non-interferable" block.
I think a workable solution could look similar to this monkey-patched version of the SessionDelegate connect method we use as a workaround for the moment:
voidconnect_with_to() {
try {
if (session ==null||!session.connected || changed) {
disconnect()
if (host ==null) {
thrownewSshException('Host is required.')
}
if (username ==null) {
thrownewSshException('Username is required.')
}
if (keyFile ==null&& password ==null) {
thrownewSshException('Password or key file is required.')
}
session = jsch.getSession(username, host, port)
if (keyFile !=null) {
if (passPhrase) {
jsch.addIdentity(keyFile.absolutePath, passPhrase)
} else {
jsch.addIdentity(keyFile.absolutePath)
}
}
if (password) session.setPassword(password asString)
if (proxyHost?.trim() && proxyPort?.trim()) {
session.proxy =newProxyHTTP(proxyHost, Integer.parseInt(proxyPort))
}
if (options.verbose) {
logger.info(">>> Connecting to $host")
}
// the following if-clause is the new interesting bitif (options.connectionTimeout !=null) {
session.setTimeout(con_timeout)
}
session.connect()
}
} finally {
changed =false
}
}
The text was updated successfully, but these errors were encountered:
Big fan of this project, works very good in general, however one thing I found painfully missing when working with it is the possibility to set a custom value for the connection timeout. The wrapped upstream library
JSch
allows this principally, but unfortunately as far as I can tell not as a configuration map option, but only by directly manipulating the session object like this:Or probably better like this:
To my understanding it is atm not possible to make
sshoogr
set this timeout parameter in clean fashion. You actually expose the session object inside the session delegate which is quite nice, but unfortunately doesn't help here as for setting the timeout to be meaningful it must obviously happen between the time frame of the session object being created andconnect
method being called on it, which is atm a "solid, non-interferable" block.I think a workable solution could look similar to this monkey-patched version of the
SessionDelegate
connect method we use as a workaround for the moment:The text was updated successfully, but these errors were encountered: