Skip to content
Young Yu edited this page May 26, 2024 · 6 revisions

Sends a value to the server, then the server sends the exact same value back.

CLI

Usage

echo <value>
  • value: The value that the server should echo back. Required.

Example: valid input

In the example below we simply echo hello world!.

> echo "hello world!"
hello world!

TCP

Assume all values are encoded using the length-prefixed protocol, without spaces in between (the spaces in the TCP format are just for clarification). For example by SET NAME JOE I mean 3\r\nSET4\r\nNAME3\r\nJOE where each value is prefixed by it's length followed by the delimiter \r\n.

Format

ECHO <value>
  • value: This is a required field specifying the value that the server should echo back.

Example

ECHO hello would be encoded as:

4\r\nECHO5\r\nhello
Clone this wiki locally