You are on page 1of 2

The aim of the task is to write a program that

imitates the operation of the HTTP server and its


clients. Write two programs - the server program
and the client program.

The server program should read client requests


from a named link (with any fixed name, eg
"listen_pipe"). The client creates and sends to the
named link the name of two named links - one for
receiving and one for sending.

After receiving both names (paths) from a single


client, the server should create a thread that will
handle the client. The main thread is supposed to
only listen on the "listen_pipe" named link and
create threads. Each thread created for customer
service is expected to read the file path from one
link and then send the contents of the file named by
the client to the other link.

Each client should ask for a random file in this


directory, and after receiving the content, display it
to standard output. For simplicity, you can name
files as numbers increasing from zero, so that
randomly selecting a file will be reduced to drawing
a number in the range [0, n - 1].

Make sure your server is running multiple clients


simultaneously (each client creates a pair of named
links with unique paths and removes them when
finished). Start your server and several hundred
client instances.

Submit the task as a .zip file containing two source


files: server.c and client.c

You might also like