200k views
1 vote
What function do you use to accept an incoming connection?

a) connect()
b) bind()
c) accept()
d) listen()

User MarwaAhmad
by
8.6k points

1 Answer

2 votes

Final answer:

The function used to accept an incoming connection in networking is the accept() function.

Step-by-step explanation:

The function used to accept an incoming connection in networking is the accept() function.When a server program is running and waiting for client requests, the accept() function is called to accept an incoming connection from a client. This function creates a new socket used for communication with the client. It returns the file descriptor of the new socket, which can then be used for receiving and sending data to the client.For example, in C programming language, the accept() function is used as follows:int newSocket = accept(serverSocket, (struct sockaddr*)&clientAddress, &addrLength);

User Ihatemash
by
7.6k points

No related questions found