Question: Use FIFO to write a client / server application with server.c and client.c . This application performs a simple instant messaging between two users on

Use FIFO to write a client/server application with server.c and client.c. This application
performs a simple instant messaging between two users on the same machine. The FIFO
names should be command line arguments. The messages should be displayed in a well-
formatted way to show the server messages and the client messages side-by-side, on both
the server's end and the client's end. See the sample run for example.
The server program should be started first. The user on the client side can decide to quit
the conversation by typing Ctrl-C. When the client stops the conversation, only the client
program is terminated. The server program will wait for the next connection from client.
The server will terminate if Ctrl-C is received from the user. When the server is
terminated, the client is also terminated.
Sample run:
>>>>>./server fifoi fifo2
Waiting for connection ...
my messages (server)
What?
What did you say?
Client left.
-
received messages (client)
Salut!
Waiting for connection ...
my messages (server)
Welcome!
I'm typing Control-C^C
received messages (client)
| I'm back!
1
COMP-2560 System Programming
>>>>>./client fifoi fifo2
Connected.
my messages (client)
Salut!
Dr. Chen
I'm typing Control-C^C
>>>>>./client fifol fifo2
Connected.
my messages (client)
I'm back!
Terminated: 15
--
received messages (server)
What?
What did you say?
received messages (server)
Welcome!
Submission: a zipped file named firstname_lastname.zip containing server.c and client.c.

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!