-
Notifications
You must be signed in to change notification settings - Fork 0
ECHO
Young Yu edited this page May 25, 2024
·
6 revisions
The ECHO command simply sends some value to the server. Then the server sends the exact same value back.
echo <value>
-
value
: The value that the server should echo back. Required.
In the example below we simply echo hello world!
then echo 2024
.
> echo "hello world!"
hello world!
> echo 2024
2024
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
.
ECHO <value>
-
value
: This is a required field specifying the value that the server should echo back.
ECHO hello
would be encoded as:
4\r\nECHO5\r\nhello