Which socket function is used by a TCP server to accept an incoming client connection?

Options

  • A. bind()
  • B. accept()
  • C. connect()
  • D. socket()
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. accept()

Detailed Explanation

Correct Answer: accept().

The accept() system call accepts a pending connection request on a listening socket and returns a new socket descriptor for communication with the connected client.