Correct option is B
1.
BIND:
Matches with II. Give a local address to a socket
The BIND function assigns a local address (IP address and port number) to a socket.
2.
LISTEN:
Matches with III. Show willingness to accept connections
The LISTEN function prepares a socket to accept incoming connection requests.
3.
ACCEPT:
Matches with I. Block the caller until a connection attempt arrives
The ACCEPT function blocks the process until a connection request is made to the socket.
4.
SOCKET:
Matches with IV. Create a new point
The SOCKET function creates a new socket for communication.
Correct Answer:
(b) A-II, B-III, C-I, D-IV
Information Booster:
1.
BIND Function: Assigns a local address to a socket, allowing the operating system to associate the socket with a specific IP address and port.
2.
LISTEN Function: Used in server-side programming to mark a socket as a passive socket, ready to accept incoming connection requests.
3.
ACCEPT Function: Once the LISTEN function is called, ACCEPT handles the incoming connection and returns a new socket descriptor for communication with the client.
4.
SOCKET Function: Creates a new communication endpoint and returns a socket descriptor for further operations.
Additional Knowledge:
·
Socket Programming Overview:
· Sockets enable communication between processes over a network.
· Functions like SOCKET, BIND, LISTEN, and ACCEPT are essential for establishing a client-server connection.
·
Types of Sockets:
·
Stream Socket (TCP): Provides reliable, connection-oriented communication.
·
Datagram Socket (UDP): Provides unreliable, connectionless communication.
·
Socket Lifecycle:
·
Client Side: Create socket → Connect to server → Send/Receive data → Close socket.
·
Server Side: Create socket → Bind to an address → Listen for connections → Accept connections → Send/Receive data → Close socket.