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
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.
Step by step
Solved in 2 steps