Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.8k views
in .NET FTP by (1.9k points)
Hi,

What is the best method to handle errors while transferring in Asynch mode. I need to keep track of things like:

- Failed and successfully transfered filenames,
- Servers to which a file failed to transfer,
- Failure to close connections when a connection to a server is broken prematurely.

I know that BEGINxxxx asynch methods "queues" actions and takes them one by one. But how do I handle an error like the above when it happens after a command has been queued?

I already posted a question about the difference between Asynch callback results and using error handlers. I suppose this issue directly relates to this question. I appreciate any example that you can give.

Thanks

3 Answers

0 votes
by (161k points)
See the other post. Basically you find out about success/failure when calling the EndXXX method.
0 votes
by (420 points)
The method of creating your own Class importing and inheriting the EnterpriseDT FTPConnection namespace/control, then working with a completely separate thread that creates an object of that class (which contains event and error handling routines) is the method I'd recommend, since then you can use totally synchronous operations in your custom class just like you would if you weren't using Asynch at all - and you still get the benefits of multithreaded programming. I stuck that suggestion in the other thread, too.
0 votes
by (1.9k points)
Hi,

Thanks for your responses. PainterEnterprises, your post is describing what I was almost doing before. I was just overwhelmed by having to deal with multithreading myself as well as locking and synchronizing. It was just recently when I started examining whether using Asynch methods will help alleviate some of this headache. It obviously did not, I need to do even more complicated stuff like measure the speed uploads for all the instantiated objects. I will try your recommendation here.

Thanks

Categories

...