Juniper / go-netconf

NETCONF implementation in Go.
Other
253 stars 110 forks source link

how to reuse ssh.Client connection #80

Closed lyonsdpy closed 5 years ago

lyonsdpy commented 5 years ago

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.