Course : Newtwork and Distributed Computing
Programmer : Avishek
Last Modified : 9/9/2024
Make sure Server.java and countries_capitals.csv files are in the same directory.
- java Server.java <port_number>
- java Client.java <host_name> <port_number>
Integers are used to represent server functions to ensure consistency between the server and the client. This allows for minimal data transmission for the client to specify what function it wants to run.
- Retrieve capital from the server for a user specified country
- Retrieve estimated population from the server for a user specified country
- Add a country, capital pair (specified by the user) to the servers memory
-1. Exit the program
Additionally, some HTTP response status codes have been used to provide response back to the client.
- Response code 201 means the requested has been successfully fulfilled. Eg. when a new country, capital pair is entered, the server adds it to its memory and issues a response code 201.
- Response code 403 means the client requested a forbidden request. Eg. when a pre-existing country, capital pair is entered, the servers doesn't duplicate the pair in its memory and issues a response code 403.