Which one of the following socket API functions converts an unconnected active TCP socket into a passive socket?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2014 Set 2 · Q24
Time
Select one answerSingle correct
Solution
Official answer: C) listen
TCP Flow and Congestion ControlIn standard BSD socket programming:
By default, a socket created with socket() is an active socket (assumed to initiate connections via connect()).
The listen() function transitions an unconnected active socket into a passive socket, indicating to the OS kernel that it should accept incoming connection requests directed to this socket.
bind() assigns a local protocol address (IP and port) to the socket.
connect() establishes an active TCP connection.
accept() retrieves the next completed connection from the queue of a listening (passive) socket.
Therefore, option (C) is correct.
Try the question first, then check your work.
Examiner trap
Which function tells the kernel to put the socket in a state where it waits for incoming connection requests?
This TCP Flow and Congestion Control previous year question is Q24 of the GATE CSE 2014 Set 2 paper. Find more GATE CSE PYQs on TCP Flow and Congestion Control in Computer Networks, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related TCP Flow and Congestion Control PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
TCP Flow and Congestion Control has 23 GATE CSE PYQs across 21 papers from 2012 to 2026. 10 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2014 Set 2.
How GATE tests TCP Flow and Congestion ControlIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.