Skip to main content

Module part

Module part 

Source
Expand description

The parts of a file a download fetches, each over its own connection: the whole file for one connection, or for several, stretches that end where the next begins.

StructsΒ§

Live πŸ”’
A connection fetching a part.
Part πŸ”’
A stretch of the file, and how much of it is saved.

ConstantsΒ§

MAX_CONNECTIONS πŸ”’
The most connections one download opens, so a large connections: can’t swamp a server.
MIN_PART_SIZE πŸ”’
The smallest part worth a connection of its own.

FunctionsΒ§

connection_count πŸ”’
How many connections a download opens when its call asks for asked: at least one, and at most MAX_CONNECTIONS.
split πŸ”’
A file of total bytes split into at most connections parts of nearly equal size, none smaller than MIN_PART_SIZE unless the whole file is.