|
1 | 1 | In this stage, you'll implement support for the [PING](https://redis.io/commands/ping) command. |
2 | 2 |
|
| 3 | +### TCP (Transmission Control Protocol) |
| 4 | + |
| 5 | +[TCP](https://en.wikipedia.org/wiki/Transmission_Control_Protocol) is the underlying protocol used by protocols like HTTP, SSH, and others you're probably familiar with. Redis also uses TCP for communication between its clients and servers. |
| 6 | + |
| 7 | +Don't worry if you're unfamiliar with the TCP protocol, or what Redis clients & servers are. You'll learn more about this in the next stages. |
| 8 | + |
3 | 9 | ### Redis Commands |
4 | 10 |
|
5 | 11 | Redis clients communicate with Redis servers by sending [commands](https://redis.io/commands/). For each command, a Redis server sends a response back to the client. |
6 | 12 |
|
7 | 13 | For example: |
| 14 | + |
8 | 15 | ```bash |
9 | 16 | $ redis-cli SET name Alice |
10 | 17 | OK |
11 | 18 | ``` |
12 | | -Here, the client sends a [`SET`](https://redis.io/docs/latest/commands/set/) command to store the key `name` with the value `Alice`. The server responds with `OK`, confirming that the action was successful. |
13 | 19 |
|
| 20 | +Here, the client sends a [`SET`](https://redis.io/docs/latest/commands/set/) command to store the key `name` with the value `Alice`. The server responds with `OK`, confirming that the action was successful. |
14 | 21 |
|
15 | 22 | Both commands and responses are encoded using the [Redis serialization protocol (RESP)](https://redis.io/docs/latest/develop/reference/protocol-spec/). We'll learn more about this in later stages. |
16 | 23 |
|
@@ -46,7 +53,7 @@ Your server should respond with `+PONG\r\n`, which is `PONG` encoded as a [simpl |
46 | 53 | ### Notes |
47 | 54 |
|
48 | 55 | - You can ignore the data that the tester sends you for this stage. We'll get to parsing |
49 | | -client input in later stages. For now, you can just hardcode `+PONG\r\n` as the response. |
| 56 | + client input in later stages. For now, you can just hardcode `+PONG\r\n` as the response. |
50 | 57 | - You can also ignore handling multiple clients and handling multiple PING commands in this stage—we'll get to that in later stages. |
51 | 58 | - The exact bytes your program will receive won't just be `PING`. Instead, you'll receive something like this: `*1\r\n$4\r\nPING\r\n`, |
52 | | -which is the Redis protocol encoding of the `PING` command. We'll learn more about this in later stages. |
| 59 | + which is the Redis protocol encoding of the `PING` command. We'll learn more about this in later stages. |
0 commit comments