You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Lyor Goldstein <lg...@apache.org> on 2019/06/23 17:48:19 UTC
Re: Sshclient pool
>> 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();