A server program that serves as a key-value store.
- PUT(key, value)
- GET(key)
- DELETE(key)
- Open up two terminal windows and navigate to
/Project1/src
- In one window, type
javac servers/*.java
(hit ↩), followed byjava servers.Main <Port#> <TCP/UDP>
, where<Port#>
is the port number the server advertises its service with, and<TCP/UDP>
instantiates the type of server that communicates with the TCP or UDP protocol (hit ↩) - The server is now running
- In the other window, type
javac clients/*.java
(hit ↩), followed byjava clients.Main <Hostname> <Port#> <TCP/UDP>
, where<Hostname>
can be either the server's hostname or IP address,Port#
is the port number the server advertises its service with, and<TCP/UDP>
instantiates the type of client that communicates with the TCP or UDP protocol (it has to match the server's) (hit ↩) - The client is now running
- The predefined protocol is:
PUT:key:value
(hit ↩)GET:key
(hit ↩)DELETE:key
(hit ↩)
- To shut down the server, type
server stop
(hit ↩) orserver shutdown
(hit ↩) - To shut down the client, type
client stop
(hit ↩) orclient shutdown
(hit ↩)