Update page 'Protocol'
24
Protocol.md
24
Protocol.md
@@ -92,6 +92,30 @@ _stream.Write(BitConverter.GetBytes(data.Length), 0, 4); // Send the length
|
|||||||
_stream.Write(data, 0, data.Length); // Send the packet
|
_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
|
## Commands
|
||||||
|
|
||||||
Each command is described in a dedicated page
|
Each command is described in a dedicated page
|
||||||
|
|||||||
Reference in New Issue
Block a user