Question: Project phase 4: Setup a picture serving server (5 points) General requirement: 1. A client ask for a picture from a server 2. The server

 Project phase 4: Setup a picture serving server (5 points) Generalrequirement: 1. A client ask for a picture from a server 2.

Project phase 4: Setup a picture serving server (5 points) General requirement: 1. A client ask for a picture from a server 2. The server sends the corresponding picture back to the client, and the client save the picture to the local disk. ******Detailed description of the both the client side code and the server side code are in the program skeleton below You can download the program skeleton and the picture from the following links: htt www.csc.lsu.edu ang/CS6210/HTMLExercise ecture23/ImageClient.iava htt www.csc.lsu.edu ang/CS6210/HTMLExercise ecture23/Imageserver.iava htt www.csc.lsu.edu wang/CS6210, HTML Exercise ecture23 /Koala Image Server code: imports java io import java.net public class Image Server public static void main (String[] args) try ServerSocket server new ServerSocket 8008 while (true) System.out.println server is waiting for connection request from clients Socket 3 server accept Buffered Reader in new BufferedReader new Input StreamReader 3. get Inputstream Data output Stream out new DataOutput Stream (3.getoutputstream Detailed requirement below Step one: check the picture name sent from the client, if the picture name equals "Koala .jpg", go to step two otherwise go to step three Step two read the picture Koala .jpg" from the local disk, and send the content back to the client step three, then reply to the client with "Sorry, no such picture step four, close the input/output streams close the socket. catch (Exception e e print StackTrace Project phase 4: Setup a picture serving server (5 points) General requirement: 1. A client ask for a picture from a server 2. The server sends the corresponding picture back to the client, and the client save the picture to the local disk. ******Detailed description of the both the client side code and the server side code are in the program skeleton below You can download the program skeleton and the picture from the following links: htt www.csc.lsu.edu ang/CS6210/HTMLExercise ecture23/ImageClient.iava htt www.csc.lsu.edu ang/CS6210/HTMLExercise ecture23/Imageserver.iava htt www.csc.lsu.edu wang/CS6210, HTML Exercise ecture23 /Koala Image Server code: imports java io import java.net public class Image Server public static void main (String[] args) try ServerSocket server new ServerSocket 8008 while (true) System.out.println server is waiting for connection request from clients Socket 3 server accept Buffered Reader in new BufferedReader new Input StreamReader 3. get Inputstream Data output Stream out new DataOutput Stream (3.getoutputstream Detailed requirement below Step one: check the picture name sent from the client, if the picture name equals "Koala .jpg", go to step two otherwise go to step three Step two read the picture Koala .jpg" from the local disk, and send the content back to the client step three, then reply to the client with "Sorry, no such picture step four, close the input/output streams close the socket. catch (Exception e e print StackTrace

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!