Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Length-prefixed framing?

Definition 16.9 University Computer Science — Year 2 · Bab 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.
Baca dalam konteks →