>> Do you have an example for such implementation ? What do you mean ? The code is simple:
// Do this ONCE in 'main'
SshClient client = setup..and..initialize
client.start();
// wherever in the code and as many times a necessary - including
concurrently
try (ClientSession session =
client.connect(...wherever...).verify(...timeout..).getSession()) {
session.addPassword/KeyIdentity(...);
session.auth().verify(...timeout...);
...use the session...
}
// when 'main' exits
client.stop();
