Sftp: Aborting BeginConnect, BeginLogin, ChangeDirectory

+1 vote
asked Aug 2, 2010 by _FRED_ (640 points)
edited Aug 3, 2010

A Sftp class has one AbortTransfer method, that "Aborts pending transfers". Does this method aborts not-transfer operations, such as connecting, logging or changing current directory?

Does Ftp::Abort aborts connecting, logging or changing current directory?

Applies to: Rebex SFTP, Rebex FTP/SSL

1 Answer

+1 vote
answered Aug 2, 2010 by Martin Vobr (12,950 points)
edited Aug 3, 2010
Best answer


  • Sftp.AbortTransfer aborts only the file(s) upload, file(s) download and getting a directory list operations. It does not abort non-transfer operations (including the ChangeDirectory).


  • Ftp.Abort tries to abort any of FTP Service Commands operation. FTP service commands include file upload, download, rename, delete file or directory, create directory, get the directory listing. For a complete list see section 4.1.3. of RFC 959. It does NOT include connect and login operations. Internally the Ftp.Abort issues the ABOR FTP command when aborting the download operation. Upload simply stops sending data. And other operation stops waiting for server response (similar to situation when timeout is exceeded).

UPDATE: Added better description what Ftp.Abort does.

commented Aug 3, 2010 by _FRED_ (640 points)
Thanks! How I can abort async connect/login operations for Ftp and any "non-transfer operation" for Sftp?
commented Aug 3, 2010 by Martin Vobr (12,950 points)
Most non-transfer operations are instant. If non-transfer operation is taking so long that it has to be canceled, it usually means that the connection is already broken or some error occurred at server. In such situations, it's recommended to dispose the Sftp/Ftp object and connect & login again.