Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Length-prefixed framing?

Definition 16.9 University Computer Science — Year 2 · Hoofdstuk 16 — Sockets

In length-prefixed framing, a message of nn bytes is sent as 4 bytes holding nn in network byte order, followed by the nn bytes. Decoding a buffer reads 4 bytes as a length nn, then takes the next nn bytes as the message, and starts again after it.

The request who 1 framed, byte by byte (offsets above): the length 5 in four big-endian bytes, then the five bytes of the message. The receiver reads the four bytes, then exactly five more; whatever follows is the next message.
The request who 1 framed, byte by byte (offsets above): the length 5 in four big-endian bytes, then the five bytes of the message. The receiver reads the four bytes, then exactly five more; whatever follows is the next message.
Lees in het hoofdstuk →