Description
Q1. Write a server program using TCP that accepts requests from clients to capitalize strings sent
by the clients. When a client connects, a new thread is started to handle an interactive dialog in
which the client sends a string and the server sends back the capitalized version of the string. Set
a maximum limit of 10 strings to accept from a client. The server capitalizes each string and
sends it back to the client with a prompt for the next string. You may choose to terminate the
connection before the maximum limit of 10 strings is reached. Send an appropriate message to
the server in that case when it prompts for next string. After the maximum limit of 10 strings is
reached, your program should close the connection automatically and display the message
“Connection Closed.” and terminate execution. You should write the corresponding client
program as well.
Q2. Write a web server that is capable of processing only 1 request. Your web server will:
i) Create a connection socket when contacted by the client (browser)
ii) Receive the HTTP request from this connection
iii) Parse the request to determine the specific file being requested
iv) Get the requested file from the server’s file system
v) Create an HTTP response message consisting of the requested file
vi) Send the response over TCP Connection to the requesting browser
If a client requests a file that is not present in your server, your server should return a “404
Not Found” error message.
Q3. (For Graduate Students only). Write a multi-threaded server program using TCP that
accepts requests from 5 clients to capitalize strings sent by the clients. When a client connects, a
new thread is started to handle an interactive dialog in which the client sends a string and the
server sends back the capitalized version of the string. Set a maximum limit of 10 strings to
accept from a client. The server capitalizes each string and sends it back to the client with a
prompt for the next string. You may choose to terminate the connection before the maximum
limit of 10 strings is reached. Send an appropriate message to the server in that case when it
prompts for next string. After the maximum limit of 10 strings is reached, your program should
close the connection automatically and display the message “Connection Closed to Client #n.”
You should write the corresponding client program as well.
The interaction of the server with multiple clients is concurrent and has to be synchronized.

