.
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.