PCPP2 Network Programming Practice Question
When implementing a custom application protocol over TCP, how should you handle message framing?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a unique delimiter or a length prefix header for each message.
Since TCP is a stream, you must implement a protocol layer (like length-prefixing) to know when one message ends and the next begins.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a unique delimiter or a length prefix header for each message.
Why this is correct
Framing techniques are necessary to parse streams into logical units.
- ✗
Rely on recv() returning one complete message at a time.
Why it's wrong here
TCP does not respect message boundaries.
- ✗
Call sleep() between sends to ensure packet separation.
Why it's wrong here
Timing does not guarantee packet separation.
- ✗
Use UDP instead for automatic framing.
Why it's wrong here
While UDP preserves boundaries, it is not a TCP solution.
About these practice questions
Courseiva writes every PCPP2 question from scratch — 194 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Python Institute exam blueprint
This PCPP2 practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCPP2 exam.