Simple multi-client server which maintains a shared ledger of (int, string)
pairs
Clone the repo and change to the repo directory
$ git clone https://github.com/Isaac-DeFrain/multi-client-server.git
$ cd multi-client-server
Install dependencies and build the project
$ opam install --deps-only .
$ dune build
Open a terminal from this directory and start the server
$ dune exec -- ./_build/default/bin/mcs.exe
Open a fresh terminal (or several), connect to the server, and send some messages
$ telnet localhost 9000
Message | What it does |
---|---|
# |
returns the server's current number of connections |
id |
returns the client's internal id number |
get <key> |
returns the ledger value associated with the key (if it exists) |
set <key> <value> |
sets the value for the key in the ledger |
del <key> |
deletes the key from the ledger |