[paramiko] closing SFTP connections

Michael Gratton michael.gratton at rsp.com.au
Sun Dec 17 15:03:22 PST 2006


Hi Robey,

Robey Pointer wrote:
> 
> An SSH transport can host more than one open channel at a time.  For 
> example, you could have two open SFTP sessions and a shell session
> all over the same transport.  So having Channel or SFTPClient close
> the Transport might prematurely close other sessions.

You know, just after sending this mail, I actually managed work
to that out myself. :)

I think the source of confusion was that SSHClient.close /does/ close
the transport and because SFTPClient is named similarly, I was expecting
it to work in the same way. Maybe it could be named SFTPChannel or
something instead... but I see it's already been renamed once.

> Since all Channel and SFTPClient objects belong to a single
> Transport, if you close the Transport (or SSHClient), it should
> automatically close all of its channels.  That will let you still
> have only one "close()" call.

Yep, but should the transport also automatically close once all channels
are closed? We are seeing this happen most times, but for something like
1 in 20 connections, if all channels are closed (we're only opening one
per transport) the transport isn't closed.

Cheers,
/Mike

-- 
Michael Gratton -- Code Wrangler
Rising Sun Pictures -- http://www.rsp.com.au/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://www.lag.net/pipermail/paramiko/attachments/20061218/1d83323c/attachment.pgp 


More information about the paramiko mailing list