GATE / CS ARCHIVE

GATE CSE 2014 SET 2 / QUESTION 24

GATE CSE 2014 Set 2 Q24

Computer Networks · Transport, Congestion Control & Traffic Shaping · Full GATE CSE 2014 Set 2 paper

GATE 2014 Set 2, Q24 1 mark · MCQ
Report issue

Transport, Congestion Control & Traffic Shaping

Question 24, GATE 2014: Which socket API call changes an unconnected active TCP socket into a passive socket? A connect; B bind; C listen; D accept.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. Set up the reasoning. A server first creates a socket and binds its local address, then marks it as a listener. The change of role occurs before an incoming connection is accepted.

2. Derive the result. listen marks a bound, unconnected TCP socket as passive, ready to receive incoming connection requests. accept then creates a connected socket for one accepted connection; bind sets a local address. Thus C.

3. Check the interpretation. connect initiates an outgoing connection; bind assigns a local endpoint; accept obtains a connected socket for an arriving client. listen is the call that establishes the passive listening role.

Original paper, page 34 · Answer key