You will write a client-server java program for transferring some files from the server to the client. The server and the client are separate programs and may be running on different computers. The...

You will write a client-server java program for transferring some files from the server to the client. The server and the client are separate programs and may be running on different computers. The server program runs and waits for requests from the client. The client program takes a file name X as a command line parameter and asks the server if it has the file X. After receiving the request, the server checks if the file X is in its current directory and lets the client know. In addition, the server tells the client some statistics regarding the visits by all previous clients. Specifically, the server sends 2 numbers , where N is the total number of requests so far, and M is the number of successful requests. The statistics include the current request, and the server must update the statistics at every request. After the initial response, if the file was available, the server sends the file to the client. The client program displays three pieces of information it receives from the server – whether the file was found and the two numbers M and N. If the file X was found, the client receives the file from the server and stores it in the current directory. After the file transfer is complete, the client displays the message “file transfer complete” and terminates. The server program keeps running forever and displays a log of current requests (including client IP address and the requested file) and the statistics.
Dec 13, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here