Two ideas for resumable Data Transfer

Source: Internet
Author: User
.

Multi-thread download and resumable data transfer were performed in March. However, they were only used to test the multipart data transfer of large files.

Implementation Process

The procedure for first transmission is as follows:

1. The server passes the file name and file length to the client.
2. Calculate the number of file blocks based on the data file length
3. The client writes the number of transferred blocks to a temporary file (as the breakpoint value)
4. If the file transfer is successful, the temporary file will be deleted.

After the first transmission fails, follow these steps:

1. The client reads the breakpoint value from the temporary file and sends it to the server.
2. The server and client move the file pointer to the breakpoint
3. transfer a file from a breakpoint

This was the idea at the time, but because the cfile class was used at the time, instead of the SDK, I had to rewrite it. During the rewrite, resumable data transfer became a problem again.

1. download the file list
2. Because efficiency does not use Block Transmission
3. How to record the file list and breakpoint values

In view of my previous resumable data transfer, the train of thought has been banned and cannot be bent until King boss prompts me to skip this bend. The train of thought is as follows:

1. The client uses createfile to open the list of files to be downloaded in open_existing mode.
2. If resumable upload is successful, use getfilesize to get the size of the resumable upload.
3. If the failure indicates that the file does not exist, create a file.

The idea is quite simple, and one advantage is that you don't need to record the breakpoint value to make profits.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.