Question: Write a multithreaded Java server which has the following properties: It listens to requests at port 12345. When a request arrives: o It creates a

 Write a multithreaded Java server which has the following properties: It

Write a multithreaded Java server which has the following properties: It listens to requests at port 12345. When a request arrives: o It creates a new thread to serve the request. o The client sends in a double array, which stored three floating-point numbers, to the server with the writeObject method of ObjectOutputStream. The three elements in the array represent the three known numbers (a, b and c) of a quadratic equation: ax+bx+c = 0 The server then calculates the roots of the quadratic equation with the following formula: - 1 - 4ac 2a o If there is no real root, i.e., b2 - 4ac 50. a null value will sent to the client with the writeObject method of ObjectOutputStream. o Otherwise, the two roots of the quadratic equation are stored in a double array and sent to the client with the writeObject method of ObjectOutputStream. O After that, the server will close the connection. Note that you only need to provide the implementation for the server, not the client. Hint: Result of square root can be obtained by using method Math.sqrt(double a)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!