2.2.3.3.2 Chunked Message Content

In this mode, the message content is segmented into multiple parts. The mode is indicated with a value of 1 in the ContentDistribution field of the message frame. A chunked message content is shown as follows.

Layout of chunked message content

Figure 5: Layout of chunked message content

The message is of the following format.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

ProtocolId

MajorVersion

MinorVersion

OperationType

ContentDistribution

Headers (variable)

...

Chunk1Size

MessageContentChunk1 (variable)

...

Trailer1

MoreChunks (variable)

...

LastChunkSize

LastTrailer

ProtocolId (4 bytes): This field contains an Int32 value that identifies the protocol. Its value MUST be hex 0x54454E2E.

MajorVersion (1 byte): This field contains a byte value that identifies the major version of the protocol. Its value MUST be 1.

MinorVersion (1 byte): This field contains a byte value that identifies the minor version of the protocol. Its value MUST be 0.

OperationType (2 bytes): The field is of type OperationType. This field identifies whether the message is for a One-Way Method or Two-Way Method and, if the message is for a Two-Way Method, identifies whether the message is a request message or reply message.

ContentDistribution (2 bytes): A value that specifies whether the content is chunked or not. Its value MUST be 1.

Headers (variable): A combination of frame header packets as specified in section Frame Headers (section 2.2.3.3.3).

Chunk1Size (4 bytes): This field is of type Int32 and specifies the length of the message content chunk.

MessageContentChunk1 (variable): A segment of the message content data whose length is specified by the last field (Chunk1Size). The number of bytes in the MessageContentChunk1 segment MUST equal the value of the Chunk1Size field.

Trailer1 (2 bytes): Indicates the end of a chunk. The type of this field is ChunkDelimiter.

MoreChunks (variable): Additional segments of the message content. Each segment consists of a ChunkSize, MessageContentChunk, and Trailer, as previously specified for the first segment. The number of bytes in MessageContentChunk MUST equal the value of the ChunkSize field.

LastChunkSize (4 bytes): This field is of type Int32 and specifies the length of the message content chunk. The size of the last chunk MUST be zero.

LastTrailer (2 bytes): Indicates the end of a chunk. The type of this field is ChunkDelimiter.