ninjaboy
ninjaboy

Reputation: 300

Guaranteed robust file copy over network in .net

It is required per requirements of some specific project to copy comparably large files over the (slow) network. The software which is doing this currently uses File.Copy to do this. Whenever an error occurs during file copy the process just retries File.Copy operation again and again.

Due to the nature of the network and the size of the files passed errors occur during data transfer somewhere in the middle of file copying which requires copying the same data over and over again.

I am thinking of a solution when file is passed in chunks and when a chunk fails to be passed (with checking a checksum preferably) then only this chunk of data is requested again, so that any data data has been already passed and verified is kept. Something like these advanced file downloaders that allow you to download parts of the files if file copying failed in the middle.

I wonder if there are some ready solutions for such purposes. Thanks in advance.

Upvotes: 1

Views: 160

Answers (1)

Marged
Marged

Reputation: 10953

If you don't mind switching technologies you could go for FTP transfer, there certainly are libraries for .net too.

FTP allows you to resume transfers.

If you need guaranteed delivery you might think about message queueing (but this won't keep you from resending on failure)

Upvotes: 1

Related Questions