Update page 'Protocol'

2019-03-19 17:47:20 +00:00
parent 745d437149
commit 9a10d0a007

@@ -92,6 +92,30 @@ _stream.Write(BitConverter.GetBytes(data.Length), 0, 4); // Send the length
_stream.Write(data, 0, data.Length); // Send the packet
```
## Request and Reply
When a request is sent, the receiver must always respond with the same command name,
only the arguments change.
This allow the sender to know if the receiver responded correctly to its request.
Here is an example with a ping command (without the end `\n`):
```md
PING
ID;ping
```
> Request
```md
PING
ID;pong
```
> Response
Here, a client send a 'ping' request to a server and the server respond with a 'pong', using the same command.
## Commands
Each command is described in a dedicated page