Visit www.myprogramminglab.com to complete select exercises online and get instant feedback.
Exercise
Modify the server from Programming Project so that the content for body is read from a file on the local hard drive instead of hard-coded into the program. This file should contain the HTML string from Programming Project. In addition, modify the server so that a new thread is created for each connection. Test the server by starting up two or more Web browsers and navigate to your site. Each browser should display the message.
Programming Project
This project shows how to create a simple Web server. Create a server program that listens on port 8000. When a client connects to the server, the program should send the following data to the client,
"HTTP/1.0 200 OK\n\n" + body
where body is the String "
When the server is running, you should be able to start a Web browser and navigate to your machine on port 8000 and view the message. For example, if the server is running on your local machine, you could point your Web browser to http://localhost:8000 and the message in body should be displayed.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.