steelbrain/node-ssh

isConnected return true on connection Error

michael-land opened this issue · 1 comments

  for (const _ of Array.from(new Array(3))) {
    console.log(ssh.isConnected());

    try {
      await ssh.connect({
        host: options.host,
        username: options.username,
        password: options.password,
        keepaliveInterval: 30000,
        readyTimeout: 5000,
      });
      break;
    } catch (error) {
    }
  }

it prints

false
true
true
roddc commented

I also have this issue, does Error mean the connection is still connected?