in reply to Telnet, XML API, and I/O Buffering
Sentinel value
Some special value marks the end of the message. This approach prevents the use of the value in the message without some form of escaping. The end of the file is a special sentinel value.
For example, C strings. A NUL terminates the string.
Length prefix
The length of the upcoming message is present before the message. This approach requires the length of the message to be known before the sender can start sending it.
For example, Perl strings. The length of the string is kept separate from the payload of the string.
|
|---|