Question: Find the solution using C language PROBLEM 1Find the solutions for the following and please use C for your code A. MULTI-FUNCTION CLIENT AND SERVER:

Find the solution using C language

Find the solution using C language PROBLEM 1Find the solutions for the

PROBLEM 1Find the solutions for the following and please use C for your code A. MULTI-FUNCTION CLIENT AND SERVER: This problem involves the development of a simple client-server application. Upon execution, the client should print a menu of possible commands, and prompt the user to enter the number of a command which should be executed on the server. Then, the client should send the number to the server (which is waiting to read requests on a predefined UDP port). The server should read the number from the client and execute the appropriate command, returning the results (as a string) to the client. The client should print the reply to the console and then be ready to accept additional commands from the user The command that should be available are; 1. Current time 2. PID (process ID) of the server 3. Random number between 1 and 20, inclusive Note: The Application Layer Protocol should be clearly defined, and must exchange data in ASCII format only. The server should be connectionless and iterative, i.e. only process one request at a time (see net2/sever.c). Don't worry about making the communication reliable, e.g by adding timeouts, etc. B. INTERRUPT HANDLER: In Part A, we didn't provide a way for the client or server to exit you have to interrupt them using C. Modify the client from Part A to implement an interrupt handler (using signalO) to "catch" the C key-press (SIGINT). Once the client detects it should send a command to the server numbered 0, which will cause the server to shut down. Modify the server from Part A to do this. Note that a user should not be able to select "O" as a command on the client side: it is only sent in response to . Additionally, when the client receives a , it should prit "Goodbye!" to the standard output, and then exit. C. CONNECTION-ORIENTED CLIENT-SERVER APPLICATION: Repeat Part A using TCP instead of UDP; that is, implement an iterative, connection-oriented server, and corresponding client. Each request should cause a new connection to be established (see ne o net3/erver

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!