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!