0 votes
by (120 points)

Hello,
In your sample FtpWinFormClient, the "Abort" button works only for Upload.

If I am trying to download and I click "Abort", the connection is blocked, and if I re-try to re-download something everything is blocked!

So I would like to know if it is a bug or the "Abort" button only concerns the upload methode???

1 Answer

0 votes
by (73.5k points)

Actually, the FTP protocol can have problems with aborting download transfers.

When uploading data: when abort is requested, client simply stops reading form input stream and the operation is aborted.

When downloading data: client sends RETR filename command and starts reading data from server. When abort is requested, client sends ABOR command to the server. Now, in ideal case, the server accepts the ABOR command and aborts the transfer. However, some servers doesn't handle ABOR command well and the transfer is aborted after couple of time (or never).

This is, how abort process looks in our test environment:

13:11:02.292 Info Info: Aborting operation.
13:11:02.294 Debug Info: Aborting downloading data connection.
13:11:02.297 Info Info: Aborting download.
13:11:02.299 Info Command: ABOR
13:11:02.300 Info Response: 426 Connection closed; transfer aborted.
13:11:02.302 Info Response: 226 ABOR command successful
13:11:02.303 Debug Info: Closing data connection.
13:11:02.305 Error Info: Rebex.Net.FtpException: The operation was aborted.

Please note the timing. Whole abort operation took 15 ms.

I tried the FtpWinFormClient sample against FileZilla Server and it works as expected.

Please, look into log window. Locate Command: ABOR line and look how the server handles it. If it looks like the log above, the Abort should not block the connection.

If you have troubles reading the log, you can post it here or send it to support@rebex.net for analysis.

by (120 points)
Thank you very much for your answer ... I will look in the log to see how I can solve this ... Thanks again !!!
...