mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Made UDP doc clearer.
This commit is contained in:
parent
a400ea39ea
commit
7266a1436c
@ -8,6 +8,8 @@ Lossless UDP:
|
||||
|
||||
Draft of Proposed protocol:
|
||||
|
||||
Connexion example:
|
||||
|
||||
Alice wants to connect to Bob (Connection handshake):
|
||||
Alice generates a random 4 byte number.
|
||||
Alice puts it in the handshake packet (handshake_id1).
|
||||
@ -37,6 +39,12 @@ Lossless UDP:
|
||||
The packet id of the missing packet(s) are added to the end of the SYNC packet.
|
||||
Alice resends the packets whose numbers appear at the end of the request packet.
|
||||
|
||||
Alice and bob disconnect suddenly:
|
||||
Alice stops receiving SYNC packets from bob.
|
||||
Bob stops receiving SYNC packets from Alice.
|
||||
Connexion times out if no data is received for 5 seconds.
|
||||
|
||||
Packet handling:
|
||||
|
||||
The client receives a SYNC packet:
|
||||
He checks if the packet is valid(sent_packetnum and counter make sense)
|
||||
@ -52,6 +60,7 @@ Lossless UDP:
|
||||
Send the packets he requested.
|
||||
|
||||
|
||||
|
||||
The client receives a Connection handshake packet(not initiating connection):
|
||||
If handshake_id2 is zero:
|
||||
add our random handshake_id2 to it and send it back
|
||||
@ -72,10 +81,6 @@ Lossless UDP:
|
||||
Keep track of the percent of packets dropped, if it is too high, lower the send rate. If it is low, increase it.
|
||||
|
||||
|
||||
Alice and bob disconnect suddenly:
|
||||
Alice stops receiving SYNC packets from bob.
|
||||
Bob stops receiving SYNC packets from Alice.
|
||||
Connexion times out if no data is received for 5 seconds.
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user