2 Message Structure
In messages values of the following three data types are used:
- byte – one byte;
- int – four bytes presented in the network byte order (most significant
byte first);
- string – has the following structure: the first byte identifies the string
format, the next four bytes (int) specify the length of the string in bytes
and the next ’length’ bytes is the string. The only supported string
format is C-string without trailing null character. The first byte equal
zero identifies C-string.
The common message structure is as follows:
- the first four bytes (int) is instruction;
- the next four bytes (int) is the length of a body in bytes;
- the next ’length’ bytes is the body.
The body of the message is determined by the instruction. In general the body of all
messages is a sequence of values of the three types listed above. The position of a
value in the sequence determines its meaning.
In the current version of Sedna the size of the message body must not exceed
10240 bytes.
|