2.2.3 Packets

A packet is the unit written or read at one point in time. A message can consist of one or more packets. A packet always includes a packet header and is usually followed by packet data that contains the message. Each new message starts in a new packet.

In practice, both the client and server will try to read a packet full of data. They will pick out the header to see how much more (or less) data there is in the communication.

At login, clients can specify a requested packet size as part of the LOGIN message stream. This identifies the size used to break large messages into different packets. Server acknowledgment of changes in the negotiated packet size is transmitted back to the client via the ENVCHANGE token stream, described in section 2.2.7.10. The negotiated packet size is the maximum value that can be specified in the Length packet header field described in section 2.2.3.1.3.