Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Length-prefixed framing?

Definition 16.9 University Computer Science — Year 2 · Capítulo 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.
Ler no capítulo →