GATE CS 2014 Set 2 — Question 34
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+1 / -0.33EasySocket ProgrammingTransport LayerComputer Networks
Computer Networks → Transport Layer → Socket Programming
Last updated
Question
Which one of the following socket API functions converts an unconnected active TCP socket into a passive socket?
Correct answer
(C) listen
Solution
In socket programming, a socket is created using the
socket() system call. By default, this socket is an active socket, meaning it is intended to be used to initiate a connection (e.g., by a client calling connect()).To use a socket on the server side to wait for incoming connections, it must be converted into a passive socket. The listen() system call performs this conversion. It marks the socket referred to by the file descriptor as a passive socket, that is, as a socket that will be used to accept incoming connection requests using accept().- connect: Initiates a connection on a socket (client side).
- bind: Assigns a local protocol address to a socket.
- listen: Converts an unconnected active TCP socket into a passive socket, indicating that the kernel should accept incoming connection requests directed to this socket.
- accept: Retrieves the first connection request on the queue of pending connections for the listening socket.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Transport Layer
2026 Set 1 Q18With respect to a TCP connection between a client and a server, which one of the following…2026 Set 1 Q19Which of the following statements is/are true with respect to the interaction of a web browser with…2026 Set 2 Q21Consider a file of size 4 million bytes being transferred between two hosts connected via a path…2026 Set 2 Q22Which one of the following protocols may need to broadcast some of its messages?2026 Set 2 Q33If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can…