@ludovicm67/lib-filetransfer
    Preparing search index...

    Type Alias TransferFilePoolOptions

    type TransferFilePoolOptions = {
        askFilePartCallback?: AskFilePartCallback;
        keepPartsOnFailure?: boolean;
        maxBufferSize?: number;
        parallelCalls?: number;
        retries?: number;
        timeout?: number;
    }
    Index
    askFilePartCallback?: AskFilePartCallback
    keepPartsOnFailure?: boolean

    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 to false: a failed download is dropped, and the next attempt starts over.

    maxBufferSize?: number

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

    parallelCalls?: number

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

    retries?: number

    How many times a part is re-asked before giving up. Defaults to 10.

    timeout?: number

    Seconds to wait for a part before asking for it again. Defaults to 1.