GetDownloadStream method has been called, most methods on that
Ftp instance will fail with "Another operation is pending" error. FTP is a single-operation protocol, and until the stream has been closed, no other FTP operations are allowed, and that includes the QUIT command (represented by the
For example, the following code would fail:
Ftp client = new Ftp();
var stream = client.GetDownloadStream("/pub/example/WinFormClient.png");
In your sample code above, you do actually close the
using block), so
Disconnect should work as well. It would be a bug if it failed despite the stream having been closed.
However, we have not been able to reproduce the bug - if we change your code to download a file from one of our servers, it works fine.
Are you able to reproduce the issue using your code with
test.rebex.net server (see the code snippet above) and
Also, please enable logging to see what is actually going on when the error occurs. To create a debug log, just add the following line to your code:
client.LogWriter = new Rebex.FileLogWriter("ftplog.txt", Rebex.LogLevel.Debug);
If needed, please post the content of ftplog.txt here or mail it to firstname.lastname@example.org for analysis.