SocketTools .NET Edition

FtpClient.TaskAbort Method ()

Abort all asynchronous tasks that are currently active.

[Visual Basic]
Overloads Public Function TaskAbort() As Boolean
[C#]
public bool TaskAbort();

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The TaskAbort method signals all background worker threads created by this instance of the class to abort their current operation and terminate as soon as possible. This version of the method will signal each active task and return immediately to the caller.

The Reset and Uninitialize methods will abort all active background transfers and wait for those tasks to complete before returning to the caller. It is recommended that your application explicitly wait for background transfers to complete or abort them using this method before allowing the program to terminate. This will ensure that your program can perform any necessary cleanup operations. If there are active background tasks running at the time that the class instance is disposed, it can force the instance to stop those worker threads immediately without waiting for them to terminate gracefully.

See Also