Write a server for a client. The client sends text messages to the server line by line.

For each line entered by the user on the client side, the server receives the line of message, calculates the number of bytes received so far, and sends them back to the client. The client terminates the communication by sending a single line with FIN. Write your server and client applications using TCP.

Your server should be able to serve multiple clients at the same time (multithreading server).

On the client side, the command line interface of the program looks like:

Java client hostname 6066
Hello
5 bytes received by server
Good Morning
17 bytes received by server
(continue ....)
FIN
Total 700 bytes received by server

The source code needs to be submitted on the blackboard by the due day of midnight Feb 2 . A demo will be conducted during the class. Each student will be asked on simple questions.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.