Computer-Networks
August 29, 2024Computer-Networks
August 29, 2024Computer-Networks
Question 315 |
Identify the correct order in which a server process must invoke the function calls accept, bind,
listen and recv according to UNIX socket API.
listen and recv according to UNIX socket API.
listen, accept, bind, recv | |
bind, listen, accept, recv | |
bind, accept, listen, recv | |
accept, listen, bind, recv |
Question 315 Explanation:
The correct order in which a server process must invoke the function calls according to UNIX socket API is
socket() creates a new socket of a certain type, identified by an integer number, and allocates system resources to it.
bind() associates a socket with a socket address structure, i.e. a specified local IP address and a port number.
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, and creates a new socket associated with the socket address pair of this connection.
send(), recv(), sendto(), and recvfrom() are used for sending and receiving data.
socket() creates a new socket of a certain type, identified by an integer number, and allocates system resources to it.
bind() associates a socket with a socket address structure, i.e. a specified local IP address and a port number.
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, and creates a new socket associated with the socket address pair of this connection.
send(), recv(), sendto(), and recvfrom() are used for sending and receiving data.
Correct Answer: B
Question 315 Explanation:
The correct order in which a server process must invoke the function calls according to UNIX socket API is
socket() creates a new socket of a certain type, identified by an integer number, and allocates system resources to it.
bind() associates a socket with a socket address structure, i.e. a specified local IP address and a port number.
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, and creates a new socket associated with the socket address pair of this connection.
send(), recv(), sendto(), and recvfrom() are used for sending and receiving data.
socket() creates a new socket of a certain type, identified by an integer number, and allocates system resources to it.
bind() associates a socket with a socket address structure, i.e. a specified local IP address and a port number.
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, and creates a new socket associated with the socket address pair of this connection.
send(), recv(), sendto(), and recvfrom() are used for sending and receiving data.
Subscribe
Login
0 Comments