Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java error function selected- g- Gabriels-MacBook-Pro : desktop gabrielcoronas javac ProxyCache.java . ProxyCache.java:24 error: cannot find symbol ProxyCache1.ja. 1inport Java.net.x nport java.io. HttpRequest requestnull: symbol:

java error

image text in transcribed

function selected- g- Gabriels-MacBook-Pro : desktop gabrielcoronas javac ProxyCache.java . ProxyCache.java:24 error: cannot find symbol ProxyCache1.ja. 1inport Java.net.x nport java.io. HttpRequest requestnull: symbol: class HttpRequest location: class ProxyCache 5public class ProxyCache i /ss Port for the proxy private static int pert /ax Socket for client connections private static ServerSocket socket ProxyCache. java:25: error: cannot find symbol HttpResponse response null: symbol: class HttpResponse location: class ProxyCache 12 13 /* Create the ProxyCache object and the socket/ public static vold init(int p) f portp ProxyCache. java:61: error: cannot find symbol response new HttpResponse (fromServer): socket new ServerSocket (port):ill in / symbol: class HttpResponse location: class ProxyCache catch (IOException e) f Systee.out printLn("Error creating socket: e): Systee.exit(-1); 17 19 21 23 3 errors Gabriels-MacBook-Pro: desktop gabrie1corona5 public static void handlelSocket client) Socket server null HttpRequest HttpResponse response-nut; request nutl: 25 26 27 28 29 /a Process request. If there are any exceptions, then sinpty e return and end this request. This unfortunately seans the * cuent will hang for a hnile, until it tieouts. */ /* Read request by using BufferedReaders/ BufferedReader fronClient System.out.p Systee.out.printin("Error reading request fron client: e new BufferedReader(new InputStreanReader(client.getInputstream))): rintln("Processing request ...) 37catch (I0Exception e)t return; 40 /. Send request to server by using Dataoutputstrean and writeBytes / server new Socket (request.getHost), request.getPort)) Dataoutputstrean toServer new DataOutputStrean(server.getOutputStrean)) toServer.writeBytes(request.toString()) /s Open socket and write request to socket a/ Fill in ) catch (UnknownHostException e) 51 52 System.out.println("Unknown host: request.getlost)) Systes.out print In(e): return catch (I0Exception e) Systes.out.print ln( "Error writing request to server:e) return; /s Read response and forward it to client by using DataImputStream and DataoutputStrean try f DataInputStreas fromserver- new DataInputStrean(server.getInputstrean))i 59

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions