Get the error encountered in Asynchronous Upload

0 votes
asked Mar 17, 2015 by maynero (390 points)

Using the solution I got here to upload file simultaneously. http://forum.rebex.net/5203/files-successfully-transferred-sftp-simultaneous-upload

In the array of task, how will I know which specific task encountered error?

Sftp sftp = new Sftp();
sftp.Connect(server);
sftp.Login(username, password);

Task[] tasks = new Task[2];
tasks[0] = sftp.PutFileAsync(@"c:\file.txt", ".");
tasks[1] = sftp.PutFileAsync(@"c:\file2.txt", ".");
tasks[2] = sftp.PutFileAsync(@"c:\file3.txt", ".");

Task.WaitAll(tasks);
sftp.Disconnect();

For above example, how will I know if which task encountered an error (error that does is not included in Rebex.IO.TransferProblemType)?

Applies to: Rebex SFTP

1 Answer

0 votes
answered Mar 17, 2015 by Tomas Knopp (58,580 points)
selected Mar 17, 2015 by maynero
 
Best answer

I guess this has been already discussed at stackoverflow.

...