Write a Java TCP socket program consisting of one client C and one local server S (localhost). Code for the client and server should be separate and contained in the respective files F1 and F2 above. Modify and use the code in the files posted on Blackboard: TCPWebClient18.java and TCPKRClient.java for the client C and TCPKRServer.java for the server S. Since we are testing behavior with no threads, the code should not have threads. Do not use System.exit() in your code. Submit your socket code in the files F1 and F2 (named as above). All the code needed should be in these two files. Include a comment at the top of each file that says how you compiled and ran the code. Capture screenshots with client and server screens during an example run and put them in the file F3. The client C 1.1 asks the user to enter a web server W's name as a string www.name.suf (for example, www.ieee.org) 1.2 prints the message "CLIENT START=" followed by C's local system time CT1 1.3 makes a TCP socket connection to the local server S listening on port 11211 1.4 sends W's name to S and waits to receive W's page from S 1.5 receives and displays the text of W's page sent to it by S 1.6 prints the message "CLIENT END=" followed by C's local system time CT2 1.7 prints the message "CLIENT DELAY=" followed by the value of CT=CT2-CT1 in milliseconds 1.8 prints the message “ROUNDTRIP TIME=" followed by the value of RT=CT-ST in milliseconds, where ST is the value of server delay sent to it by S. The local server S (localhost) 1.9 listens for and accepts the connection from C on port 11211 1.10 receives and prints the message "WEB SERVER=" followed by W's name sent by C 1.11prints the message "IP ADDRESS=" followed by W's IP address 1.12 prints the message "SERVER START=" followed by S's local system time ST1 1.13 uses the class HttpURLConnection to connect to the web server W on port 443 1.14 receives W’s page from the web server W 1.15prints the message "SERVER END=" followed by S's local system time ST2 1.16 prints the message "SERVER DELAY=" followed by the value of ST=ST2-ST1 in milliseconds 1.17 sends to C the page received from the web server W 1.18 sends to C the value of ST

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Could you please with writing this code? Thank you. 

Write a Java TCP socket program consisting of one client C and one local server S (localhost). Code for the client
and server should be separate and contained in the respective files F1 and F2 above. Modify and use the code in the
files posted on Blackboard: TCPWebClient18.java and TCPKRClient.java for the client C and TCPKRServer.java
for the server S. Since we are testing behavior with no threads, the code should not have threads.
Do not use System.exit() in your code. Submit your socket code in the files F1 and F2 (named as above). All the
code needed should be in these two files. Include a comment at the top of each file that says how you compiled and
ran the code. Capture screenshots with client and server screens during an example run and put them in the file F3.
The client C
1.1 asks the user to enter a web server W's name as a string www.name.suf (for example, www.ieee.org)
1.2 prints the message "CLIENT START=" followed by C's local system time CT1
1.3 makes a TCP socket connection to the local server S listening on port 11211
1.4 sends W's name to S and waits to receive W's page from S
1.5 receives and displays the text of W's page sent to it by S
1.6 prints the message "CLIENT END=" followed by C's local system time CT2
1.7 prints the message "CLIENT DELAY=" followed by the value of CT=CT2-CT1 in milliseconds
1.8 prints the message "ROUNDTRIP TIME=" followed by the value of RT=CT-ST in milliseconds, where ST is
the value of server delay sent to it by S.
The local server S (localhost)
1.9 listens for and accepts the connection from C on port 11211
1.10 receives and prints the message "WEB SERVER=" followed by W's name sent by C
1.11prints the message "IP ADDRESS=" followed by W's IP address
1.12 prints the message "SERVER START=" followed by S's local system time ST1
1.13 uses the class HttpURLConnection to connect to the web server W on port 443
1.14 receives W's page from the web server W
1.15prints the message "SERVER END=" followed by S's local system time ST2
1.16 prints the message "SERVER DELAY=" followed by the value of ST=ST2-ST1 in milliseconds
1.17 sends to C the page received from the web server W
1.18 sends to C the value of ST
Transcribed Image Text:Write a Java TCP socket program consisting of one client C and one local server S (localhost). Code for the client and server should be separate and contained in the respective files F1 and F2 above. Modify and use the code in the files posted on Blackboard: TCPWebClient18.java and TCPKRClient.java for the client C and TCPKRServer.java for the server S. Since we are testing behavior with no threads, the code should not have threads. Do not use System.exit() in your code. Submit your socket code in the files F1 and F2 (named as above). All the code needed should be in these two files. Include a comment at the top of each file that says how you compiled and ran the code. Capture screenshots with client and server screens during an example run and put them in the file F3. The client C 1.1 asks the user to enter a web server W's name as a string www.name.suf (for example, www.ieee.org) 1.2 prints the message "CLIENT START=" followed by C's local system time CT1 1.3 makes a TCP socket connection to the local server S listening on port 11211 1.4 sends W's name to S and waits to receive W's page from S 1.5 receives and displays the text of W's page sent to it by S 1.6 prints the message "CLIENT END=" followed by C's local system time CT2 1.7 prints the message "CLIENT DELAY=" followed by the value of CT=CT2-CT1 in milliseconds 1.8 prints the message "ROUNDTRIP TIME=" followed by the value of RT=CT-ST in milliseconds, where ST is the value of server delay sent to it by S. The local server S (localhost) 1.9 listens for and accepts the connection from C on port 11211 1.10 receives and prints the message "WEB SERVER=" followed by W's name sent by C 1.11prints the message "IP ADDRESS=" followed by W's IP address 1.12 prints the message "SERVER START=" followed by S's local system time ST1 1.13 uses the class HttpURLConnection to connect to the web server W on port 443 1.14 receives W's page from the web server W 1.15prints the message "SERVER END=" followed by S's local system time ST2 1.16 prints the message "SERVER DELAY=" followed by the value of ST=ST2-ST1 in milliseconds 1.17 sends to C the page received from the web server W 1.18 sends to C the value of ST
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Excel Sheet
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education