edited by
11,127 views
34 votes
34 votes

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

  1. $\textsf{connect}$
  2. $\textsf{bind}$
  3. $\textsf{listen}$
  4. $\textsf{accept}$
edited by

3 Answers

Best answer
35 votes
35 votes

(C) is answer $\textsf{listen}$ converts unconnected socket into passive $\textsf{connect}$ i.e it is waiting for request from client.

edited by
17 votes
17 votes
  1. connect
    This system call sends SYN packets — it does something, so active.
     
  2. bind
    This system call binds the local machine's IP and port address to the socket — it does something, so active.
     
  3. listen
    This system call just makes the machine wait for someone to send a SYN packet — clearly passive.
     
  4. accept
    This system call sends ACK in response to SYN packets — it does something, so active.

Option C

Answer:

Related questions

27 votes
27 votes
4 answers
1
25 votes
25 votes
3 answers
2
go_editor asked Sep 28, 2014
9,750 views
The number of distinct positive integral factors of $2014$ is _____________
54 votes
54 votes
9 answers
3