Can I add timeout for ftpslib connection?
Can I add timepout for ftps connection and each command on ftp server ?
r = ftpslib.FTP_TL开发者_StackOverflow社区S() ...
In python >= 2.6, the timeout option has been added to FTP
constructor. It will be used for each blocking operation (ie connection, receive, sending...).
In python >= 2.7, the FTP_TLS
object has been added (with timeout).
In python < 2.7, you'll have to modify the default global timeout on socket module with socket.setdefaulttimeout(timeout)
before creating the FTP or FTP_TLS object.
精彩评论