OptionalaskOptionalkeepOptionalmaxNumber of bytes to ask for at a time. Defaults to 16384 (16 KiB), the
message size a WebRTC data channel handles everywhere.
Smaller parts mean more requests, and more bookkeeping for each of them.
OptionalparallelHow many parts to ask for at the same time. Defaults to 4.
Requesting parts one by one leaves the channel idle while each one travels, so overlapping them is what makes a transfer fast.
OptionalretriesHow many times a part is re-asked before giving up. Defaults to 10.
OptionaltimeoutSeconds to wait for a part before asking for it again. Defaults to 1.
Keep the parts that were already received when a download fails, so that a later attempt only asks for the missing ones instead of downloading the whole file again.
Those parts are held in memory until the download succeeds or
clearFile()is called, which for a large file can be a lot of memory. It therefore defaults tofalse: a failed download is dropped, and the next attempt starts over.