I am using Fluent FTP. The documentation says that you set the connection timeout with .ConnectTimeout
, but the C# compiler says this is not a member of FTPClient
.
How do I set the timeout?
I am using Fluent FTP. The documentation says that you set the connection timeout with .ConnectTimeout
, but the C# compiler says this is not a member of FTPClient
.
How do I set the timeout?
FTPClient.ConnectTimeout
was used in older versions.
Currently, there's FtpConfig.ConnectTimeout
. And the FtpConfig
goes to the FtpClient
constructor.
Here's my fixed code - many thanls to Martin..
Private Function ftp() As FtpClient
Dim c = New FtpClient(optFTPServer, NetCredentials.UserName, NetCredentials.Password)
AddHandler c.ValidateCertificate, AddressOf validateCert
c.Config = New FtpConfig
With c.Config
.ConnectTimeout = 60000
.ReadTimeout = 60000
End With
Try
c.AutoConnect()
Catch ex As Exception
FTPcatastrophicError = ex.Message
End Try
Return c
End Function