Courseiva
Network ProgramminghardMultiple SelectObjective-mapped

PCPP2 Network Programming Practice Question

Which THREE of the following are true regarding the use of the socket module in Python?

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

Sockets are identified by file descriptors in the OS.

Sockets are file descriptors, they can be set to non-blocking mode, and they must be closed to avoid resource leaks.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Sockets are identified by file descriptors in the OS.

    Why this is correct

    Sockets are file-like objects backed by OS descriptors.

  • Non-blocking sockets raise BlockingIOError if an operation cannot complete.

    Why this is correct

    This is the standard indicator of a non-blocking delay.

  • The socket.socket() function is a factory for socket objects.

    Why this is correct

    It creates and returns a new socket object.

  • The send() method is guaranteed to send the entire buffer requested.

    Why it's wrong here

    send() might return a partial count; sendall() is needed for the full buffer.

  • Closing a socket does not terminate the underlying file descriptor.

    Why it's wrong here

    Closing it releases the descriptor.

About these practice questions

This PCPP2 question is part of Courseiva's 194-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.