Tip: For detailed documentation refer to the IntelliSense tips that appear when you call a given API method.
SslSessionLength
. Returns the number that must be stored in your application's source code or config file, and then passed to SslSessionLength
at a later time.At various intervals, we need to reconnect to the FTP server automatically.
This happens during upload and download, and is handled within UploadFileInternal
(sync/async) and DownloadFileInternal
(sync/async).
These functions detect if the FTP connection was lost and automatically try to reconnect and resume the transfer.
It is always enabled and does not require configuration as such.
FTP Connection gets corruptedThis is only needed and enabled for FTPS/SSL connections and not for plaintext FTP.
We noticed that the underlying .NET SSL stream gets "corrupted" (goes into a unrecoverable state and throws an IOException
) after around 900 FTP responses are received from the server. So we developed this system to bypass this limitation: we count the FTP responses received, and then pre-emptively disconnect and reconnect to the FTP server. Please note that this is a bug in the .NET runtime and not with FluentFTP.
It is enabled by default but can be disabled. You can configure it using the setting Config.SslSessionLength
(docs above).
You can use code similar to this to calibrate the best value for your FTP server.
Once you get the value, save it in your application's source code or config file, and then manually set it into SslSessionLength
at runtime.
using (var client = new FtpClient("ftp://xxx.com/", "xxx", "xxx")){ client.Config.EncryptionMode = FtpEncryptionMode.Explicit; client.Config.ValidateAnyCertificate = true; int maxSslCommandLimit = client.DiscoverSslSessionLength(); Console.WriteLine("Set SslSessionLength to less than: " + maxSslCommandLimit); }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4