Question: In C programming language The service provides storage and retrieval of (key, value) pairs. Both keys and values are ascii strings with length at most
In C programming language
The service provides storage and retrieval of (key, value) pairs. Both keys and values are ascii strings with length at most 40 characters. You can assume that each string includes only alphanumeric characters, without imbedded blanks or punctuation or other special characters. There can be at most one (key, value) pair stored in the system for any particular key. Your client should take as command line arguments the host name and port number of the server (or proxy server see below) that it should connect to, and read commands from stdin. Your client should support the following commands:
-
add key value : add (key, value) pair, if no existing pair with same key value
-
getvalue key : return value from matching (key, value) pair, if any
-
getall : return all (key, value) pairs
-
remove key : remove matching (key, value) pair, if any
-
quit : terminate client
Design and implement a UDP-based server. Also implement a proxy server that uses TCP to communicate with your client, and UDP to communicate with your UDP- based server. For getall, your UDP-based server should return each (key, value) pair in a separate UDP segment. Your proxy should take as command line arguments the host name and port number for your UDP-based server. whenever your proxy encounters the substring cmpt (all lower-case letters) in a value returned by the (real) server, this substring should be replaced by ***. For simplicity, you can make the assumption that UDP segments are always received correctly and in the order that they were sent.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
