StreakPeaked· Practice

ExamsGATETechnical

Which one of the following socket API functions converts an unconnected active TCP socket into a passive socket?

  1. connect
  2. bind
  3. listen
  4. accept

Correct answer: listen

Solution

In TCP socket programming, a socket becomes passive when it is put into listening mode. The `listen()` call converts a bound active socket into a passive socket that can accept incoming connection requests.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →