Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

What are negative messages? (Objective 1)

Answered: 1 week ago