doc/proto.texi | 14 +++++++++++--- diff --git a/doc/proto.texi b/doc/proto.texi index 7d80dec27df49b91c36a163b4207d845649cb942ce0c4d4be9fcec22c326a791..9758938e7c481b6e68597f189ccf6ed291f33f726187af55a91d89fa6c3a6943 100644 --- a/doc/proto.texi +++ b/doc/proto.texi @@ -38,10 +38,18 @@ client if there are too many peers or its name is already taken. @item The 128-bit cookie is sent by client over UDP to the server every second. If UDP packets are lost, then no connection is possible and -after a timeout the server drops the TCP connection. +after a timeout the server drops the TCP connection. That cookie means: -@item Otherwise it replies with @code{SID XXX}, where XXX is ASCII -decimal stream number client must use. + @itemize + @item confirmation of successful handshake on client side; + @item UDP hole punching of stateful firewall or NAT; + @item fact of client's UDP traffic ability to reach the server; + @item client's UDP address knowledge (after passing NAT, its port + may differ from known to client one) + @end itemize + +@item Server replies with @code{SID XXX}, where XXX is ASCII decimal +stream number client must use. @item @code{PING} and @code{PONG} messages are then sent every ten seconds as a heartbeat.