Juniper/go-netconf

how to reuse ssh.Client connection

Closed this issue · 0 comments

Devices always have connection number limit , so I don't want to negotiate the ssh every time , then I try to cache the *ssh.Client and reuse it , but it seems not support in this lib.
the satisfactory result may look like this:

  1. Do TCP connection and negotiate SSH , Create *ssh.Client as ClientX
  2. If there's a SSH command request , Create a ssh session on ClientX , then do something , then release the session
  3. if there's a Netconf request ,Create a netconf session on the same ClientX. And the same logic to sftp.