Date of Lab: September 16, 2010
Report is due: to be determined (submission: by e-mail to the TA)
Note: It is suggested to use the Java programs GenericClient.java and HttpMirror.java given in the book "Java Examples in a Nutshell" by D. Flanagan (editor O'Reilly). Here are a few pages explanations from that book. If you would like to work in another programming language, you must translate the given programs into your language of choice.
Part 1 – After compiling the given programs, do the following:
Part 2 – Modify the server program such that it can handle more than one client at the same time (hint: use multi-threading - see suggestion). Include the program code in your report.
Perform other experiments necessary to answer the following questions.
Part 3 (optional) – Modify the server program to become a real "HTTP server" that it is able to return html files to the client when the client sends a URL of the form http:// ... /file.html
Questions
Q1- What happens if we run more than one client at the same time for the server in Part 1?
Q2- What happens if we run more than one client at the same time for the server in Part 2?
Q3- Compare and explain differences and similarities between Q1 and Q2. Can we justify the need for a multithreaded server?