使用FluentFTP C#连接GoDaddy托管WordPress FTP超时问题排查
问题描述
多次调用以下Connect方法时均抛出TimeoutException,但通过FileZilla可正常连接GoDaddy FTP服务器,怀疑是代码配置存在疏漏。
相关代码
public void Connect() { this.FluentClient.Config.RetryAttempts = 5; this.FluentClient.Config.EncryptionMode = FtpEncryptionMode.Implicit; this.FluentClient.Config.DataConnectionEncryption = true; this.FluentClient.Config.ValidateAnyCertificate = true; this.FluentClient.Config.DataConnectionType = FtpDataConnectionType.AutoActive; this.FluentClient.Config.DownloadDataType = FtpDataType.Binary; this.FluentClient.Config.SocketKeepAlive = true; this.FluentClient.Config.StaleDataCheck = true; this.FluentClient.Config.ConnectTimeout = 3000; this.FluentClient.Config.ReadTimeout = 30000; this.FluentClient.Config.DataConnectionConnectTimeout = 30000; this.FluentClient.Config.DataConnectionReadTimeout = 30000; this.FluentClient.Connect(); }
配置环境
- .NET Framework 4.7.2
- FluentFTP 50.0.1
- GoDaddy托管WordPress FTP
补充信息
- 可通过FileZilla正常连接该FTP账号
- GoDaddy官方文档明确说明,托管WordPress使用的SFTP仅支持主动模式
- 通过cmd命令行登录时同样出现超时错误
内容的提问来源于stack exchange,提问作者Amen Jlili
相关产品推荐
相关产品推荐

