This project includes a TCP server and client that collaborate to create a basic key-value store with timestamp support. The server manages data storage and responds to client requests, while the client can both retrieve and store data.
- Connection Handling: Manages incoming TCP connections.
- Data Storage: Uses a global dictionary for timestamped key-value storage.
- PUT Command: Stores or updates data.
- GET Command: Retrieves data based on keys.
- Error Handling: Deals with invalid commands.
- Execution: Listens on 127.0.0.1 and port 8888.
Run server.py to start the server.
- Connection Creation: Establishes a TCP connection to the server.
- GET Command: Sends get requests to retrieve data.
- PUT Command: Sends put requests to store or update data.
- Error Handling: Manages various errors including timeouts and socket errors.
- Response Parsing: Parses server responses.
Utilize the Client class in client.py to interact with the server.
- Python 3.x
asynciolibrary for the serversocketlibrary for the client
- Clone the repository.
- Make sure the required libraries are installed.
- Start the server by running
server.py. - Use the client in
client.pyto interact with the server.