TCP gives you bytes without boundaries, so the protocol must say where a message ends. Two common ways: a delimiter such as a newline, or a length prefix (a fixed-size number before the payload). See stream.