Skip to content

FrameBufferOptions

Defined in: packages/protocol/src/frame-buffer.ts:27

Configuration options for FrameBuffer.

optional maxPayloadSize: number

Defined in: packages/protocol/src/frame-buffer.ts:48

Maximum allowed payload size in bytes.

Defaults to DEFAULT_MAX_PAYLOAD_SIZE (1GB). Cannot exceed ABSOLUTE_MAX_PAYLOAD_SIZE (~2GB, Node.js limit).

Use cases:

  • Lower limit for control messages: 1MB
  • Default for data plane: 1GB
  • Higher for large file transfers: up to 2GB
// Strict limit for small messages
new FrameBuffer({ maxPayloadSize: 1024 * 1024 }) // 1MB
// Allow large files
new FrameBuffer({ maxPayloadSize: 2 * 1024 * 1024 * 1024 - 1 }) // ~2GB