UMIS SDK
    Preparing search index...

    Function chunkFrame

    • Cuts a frame into chunks that fit a link whose largest write is mtu bytes. Every chunk starts with the header [msgId, index, total] (one byte each; index counts from 0) and carries at most mtu - 3 bytes of the frame, so the chunks of one frame are ceil(length / (mtu - 3)) and never more than 255. A frame that is empty, longer than LIMITS.frameMaxBytes, or too long for 255 chunks of this size is INVALID_ARGUMENT, and so is an msgId outside 0 to 255. The sender gives each frame its own msgId, counting up and wrapping at 256.

      Parameters

      • frame: Uint8Array
      • mtu: number
      • msgId: number

      Returns Uint8Array<ArrayBufferLike>[]