Multi‑thread HTTP download

Source: Internet
Author: User
The multiplexing technology is not used for every connection thread.

An allocation is made.Algorithm. After the first HTTP request returns the contentlength, if multiple connections are used for download, an allocation algorithm is required to allocate the range corresponding to each request. The allocated part may be a continuous block, such as bytes = 100-999, or some broken blocks, such as bytes = 500-600,700-800,850-999. To this end, I made a data structure, which provides functions similar to Java. util. bitset and supports and, or, and other operations.

Implements the interpretation of the HTTP message body whose contenttype is multipart/bytes. If an HTTP request and range are sent for multiple discontinuous parts, the returned HTTP message is a multipart. Each part contains a head and a body, and a parser is required.

The next step is to add HTTP downloads to P2P downloads!

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.