Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 " + body, where body is the HTML string to send. For example, if you send: "This web page was sent by our simple Java Server " then this message will be displayed on your web browser. The header line identifies the message as part of the HTTP protocol that is used to transmit web pages. 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.

Using this approach make a specialized web server that randomly picks one of the following 8-ball responses with equal likelihood and sends it to the web browser. The server should continue running after a client is finished and handle a new request. The 8-ball responses are:

It is certain

It is decidedly so

Without a doubt

Yes, definitely

You may rely on it

As I see it, yes

Most likely

Outlook good

Yes

Signs point to yes

Reply hazy try again

Ask again later

Better not tell you now

Cannot predict now

Concentrate and ask again

Don't count on it

My reply is no

My sources say no

Outlook not so good

Very doubtful

Modify the server so that a new thread is created for each connection. This won't really impact the functionality since each thread should exit so quickly, but if the thread did more work or blocked somewhere then it would be noticeable.

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Briefly define the types of wills.

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago