Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help with this Java F1. NameA1TCPClient.java F2.NameA1TCPServer.java 1. Write a Java TCP socket program to do the following (modify the relevant client and server

Please Help with this Java

F1. NameA1TCPClient.java

F2.NameA1TCPServer.java

1. Write a Java TCP socket program to do the following (modify the relevant client and server code on Blackboard). Submit your socket code in the files F1 and F2 (named as above).

1.1 The client

1.1.1 makes a TCP connection to the localhost server (LS) on port 6789.

1.1.2 reads the string with the Web server name W sent to it by the server LS.

1.1.3 makes a TCP connection on port 80 to the Web server W.

1.1.4 creates a correct HTTP Get request automatically and sends it to the Web server W.

1.1.5 prints the text (as is) from the initial page that is received from the Web server W (it should not be an error message since the Get request is correct).

1.1.6 finds and prints the total number of bytes N received from the Web server W.

1.1.7 finds and prints the total time T in milliseconds between sending the Get request and receiving all the text in the page

1.1.8 sends the string W, and the values of N and T to LS over the TCP connection on port 6789.

1.1.9 closes the connection to LS.

1.2 The localhost server (LS)

1.2.1 asks the user to enter a single string with the server name W of a Web server to connect to (for example: www.towson.edu). User will only enter the preceding input (exactly as specified).

1.2.2 reads the string with the Web server name W entered by the user.

1.2.3 waits for the client to connect to it on TCP port 6789.

1.2.4 sends the string with the Web server name W to the client when the client connects.

1.2.5 reads and prints the string W, and the values of N and T sent to it by the client.

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

Students also viewed these Databases questions

Question

Is utilitarianism a hedonist moral theory? Why or why not?

Answered: 1 week ago

Question

Compare wages in Romania to wages in your home country.

Answered: 1 week ago

Question

4. Design a career management system.

Answered: 1 week ago

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago