Closed ReevesL closed 4 years ago
@ReevesL Can you please try with reconnect false, ssh2-promise have additional configuration for reconnect option
var sshconfig = {
host: theIp,
username: theUser,
readyTimeout: readyTimeout,
reconnect: false
};
reconnect: false
That did the trick, thanks!
Hi all,
I was attempting to shorten the time to failure for unresponsive machines but found the readyTImeout doesn't behave as expected. With SSH2 if I set readyTimeout to 2000 and attempt to connect to a non-existent machine it fails in 2 seconds as expected. With ssh2-promise the failure takes over a minute.
Here is sample code to demonstrate what I'm seeing. There are code blocks for ssh2-promise and ssh2. I would expect the behavior to be identical.
ssh2-promise: long time for connection failure
ssh2: fails in 2sec as expected