C# CancellationToken support for rebex ftp

+1 vote
asked May 9, 2019 by mayank1707 (280 points)

Is c# cancellation token supported for rebex ftp/sftp?
I want to cancel the ftp/sftp operation if the cancellation is requested. How can I achieve that?

Applies to: Rebex SFTP, Rebex FTP/SSL

1 Answer

0 votes
answered May 9, 2019 by Lukas Pokorny (126,910 points)

.NET CancelationToken is not supported yet - Rebex FTP and SFTP use a cancelation API (Sftp.AbortTransfer and Ftp.Abort methods) that predate .NET CancelationToken API.

To integrate Rebex FTP and SFTP into systems based on CancelationToken, CancelationToken.Register method can be used to trigger cancelation of Rebex operation when needed.