GATE : Computer Science and IT

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

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




Solution
C. listen



Explanation

 A) The connect function is used by a TCP client to establish a connection with a TCP server.
B) The bind function assigns a local protocol address to a socket. With the Internet protocols, the protocol address is the combination of either a 32-bit IPv4 address or a 128-bit IPv6 address, along with a 16-bit TCP or UDP port number.
C) The listen function converts an unconnected socket into a passive socket, indicating that the kernel should accept incoming connection requests directed to this socket.
D) The accept function is called by a TCP server to return the next completed connection from the front of the completed connection queue. If the completed connection queue is empty, the process is put to sleep (assuming the default of a blocking socket).

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad