connections from port 8900 and listen for characters coming from the client in a loop. When the "0" (zero) character is received by the client, it will convert all the characters that have come so far into a String and write it to a text file named "incoming_t

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

There are two java classes called Server and Client that you need to develop.

 

Server class will accept connections from port 8900 and listen for characters coming from the client in a loop. When the "0" (zero) character is received by the client, it will convert all the characters that have come so far into a String and write it to a text file named "incoming_text.txt" (you can use the FileWriter class) and terminate the Server application.

 

The Client class will connect to the Server application that listens to the 8900 port of the computer with the IP number 127.0.0.1 and will transfer each character that the Client user enters one by one from the keyboard (the characters will be taken one by one with the help of a loop) to the Server application one by one. If the client user enters the "0" (zero) character, it will stop receiving input from the user, transmit the "0" character to the Server application and terminate the Client application.

 

The sample console output of the client application is as follows:

 

Connected to the server!

Enter the text:

h

e

l

l

o

0

Transmission completed.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning