NodeOPCUA API Documentation
    Preparing search index...

    Class MessageChunker

    Index
    • Parameters

      • Optionaloptions: MessageChunkerOptions

      Returns MessageChunker

    maxChunkCount: number
    maxMessageSize: number
    securityMode: MessageSecurityMode
    defaultChunkCount: number
    defaultMaxMessageSize: number

    the maxMessageSize of a chunker created without one

    maxRetainedEncodeBufferSize: number

    the largest encode buffer kept from one message to the next

    minimumMessageSizeHint: number

    floor for the growable encode buffer, so tiny messages do not keep reallocating

    • writes message as one or more chunks, handed to messageChunkCallback in order, then null; returns a bad StatusCode, without calling back, when the message cannot be sent (too large for the negotiated limits, or security options the chunker cannot apply). A signature produced asynchronously needs chunkSecureMessageAsync.

      Parameters

      • msgType: string
      • params: ChunkMessageParameters
      • message: BaseUAObject
      • messageChunkCallback: MessageCallbackFunc

      Returns StatusCode

    • chunkSecureMessage for an asynchronous signature (the OPN signature produced by a remote HSM/KMS provider): the chunks are delivered to the callback, in order, once all are signed, and the returned promise settles after the final null callback. A provider failure rejects and delivers nothing. Messages chunked while it waits are delivered after it, in order.

      Parameters

      • msgType: string
      • params: ChunkMessageParameters
      • message: BaseUAObject
      • messageChunkCallback: MessageCallbackFunc

      Returns Promise<StatusCode>

    • Returns void

    • The largest message body the chunker accepts with these parameters, or 0 when neither limit applies: the negotiated maxMessageSize, and maxChunkCount times what one chunk carries under the channel's security. The second is the tighter one whenever a peer derives its chunk count as maxMessageSize / bufferSize, as the CTT does, because every chunk also spends bytes on headers.

      Parameters

      • _msgType: string
      • params: ChunkMessageParameters

      Returns number

    • a SecureMessageChunkManager for a message of messageLength bytes, sharing this chunker's sequence numbers, after the maxChunkCount and maxMessageSize checks.

      Deprecated: the chunker writes every message with a SecureChunkWriter, which produces the same bytes. Kept for code that drives the chunk managers itself; to be removed in the next major version.

      Parameters

      • msgType: string
      • params: ChunkMessageParameters
      • messageLength: number

      Returns { chunkManager: SecureMessageChunkManager | null; statusCode: StatusCode }