GATE Exam | Aptitude Questions | GATE Syllabus | GATE Result | Mock Test | GATE Preparation
0 votes

Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIX socket API.

A

listen, accept, bind recv

B

bind, listen, accept, recv

C

bind, accept, listen, recv

D

accept, listen, bind, recv

asked in TCP/UDP and sockets by gate

1 Answer

0 votes
bind() associates a socket with a socket address structure, 
i.e. a specified local port number and IP address.

listen() causes a bound TCP socket to enter listening state.

accept() accepts a received incoming attempt to create a new
TCP connection from the remote client, 

recv() is used to receive data from a remote socket. 
answered by gate

Related questions

The best answer to any question