简体   繁体   中英

Using phpseclib to close a Net_SFTP connection

I have a program written in PHP that distributes files to various FTP sites. Recently, I added SFTP support to it using phpseclib . It's very easy to use to log in and upload the files.

However, there doesn't seem to be an explicit function to close a connection. This is important to me because I'm dealing with connecting /disconnecting to a number of sites during the processing.

How can I close a Net_SFTP connection?

Does undefining your connection work ( as mentioned in this Perl 5 example )?

unset($sftp);  

where $sftp is the variable holding your connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM