New! Hire Essay Assignment Writer Online and Get Flat 20% Discount!!Order Now
ENN523
AU
Queensland University of Technology
Assignment tasks are described below:
Server Client
(1) When the Server is started, it initializes the settings of the server’s IP address, port number,and the client’s IP address, etc., through command window arguments, e.g., header file, arguments to main(), keyboard input, or input from a configuration file which is a pure text file.
(2) Every 3 seconds, the Server sends the Client a command to ask for data, e.g., through a single letter “R” or “r” (request). (Timing control is required here. Using our examples in the lecture materials if you like.)
(3) After receiving the command from the Server, the Client sends back to the Server an ACK consisting of the client’s time hh:mm:ss:xxx (“xxx” means three digits, e.g., 251, indicating 251 ms) and also a random integer number between 0 and 100 with a uniform distribution. The Client may also display some useful information on its monitor. It is up to your design on what information the Client displays. (You may use a random generator to generate random numbers. For example, rand()%101; srand(time(NULL)) can give a seed for rand(), where time() is defined in header file time.h).
(4) The Server gets the feedback from the Client, and display the result.
(5) The Server reads keyboard input of various command and instructions. An obvious command is to terminate the Server program, e.g., using a single letter “E” or “e” (exit). When the Sever is to be terminated, the Server should also notify the Client of the Server’s termination so that the Client also terminates properly. How to test your programs:
(1) At early stages of your program development, you may test your programs on a single computer. Execute the Server program in one command window, and execute the Client program in another command window. Both the Server and Client share the same IP address, e.g., the Loopback IP address 127.0.0.1.
(2) If you test your programs in computer labs, you may execute the Server and Client programs on two different computers, which have different IP addresses.
15,000+ happy customers and counting!