Question 1:
The correct answer is second option i.e., the client connects to the server, which returns a socket descriptor.
A socket descriptor is created with server IP address and client port.
All the communication will be done using socket descriptor.
Question 2:
The correct answer is fourth option i.e, associates a network address with a open socket descriptor.
bind() method binds the IP address with the port.
Question 3:
The correct answer is third option i.e., the consumer can take items from an empty buffer.
Before getItemFromBuffer() is called in consumer, there is no wait() method.
Hence it does not check whether buffer is empty or not and try to take items from even an empty buffer.
Question 4:
Correct answer is second option i.e., cat file1 | wc -l
The contents of the file "file1" are copied into the file "wc -l" in the program.
Hence cat operation should be done on both files and the syntax is correct in option 2.
need answers, thx 1. Which of the following best describes how clients interact with servers in...