Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix udp hole punching #43

Merged
merged 5 commits into from Jan 22, 2018
Merged

Conversation

povilasb
Copy link
Contributor

Fixed final ack-ack message sending.

Those functions send appropriate packets. But it's not like they are called 'from' those states (syn, ack-ack, etc.) like 'recv_from_syn'.
Therefore, the names were misleading and didn't follow the naming logic of the rest of the code.
Will be possible to reuse code.
@povilasb
Copy link
Contributor Author

Actually, the fix is done, but I'd like to write some tests for the fixed function which I haven't figured out how to do yet.

Send the final ack-ack messages - without them remote peer sometimes gets lost.
Before these changes that was just a dummy recursion doing nothing.
When response timesout after messages (syn, ack, etc.), we used to retry the message and extend the previous timeout by 200 miliseconds.
But in reality because of network latency and CPU execution time we might leave only a fraction of time for the future message. Or even worse case, we might specify timeout that is already finished.
This little change makes sure we give at least 200 miliseconds for each response to arrive.
@povilasb povilasb changed the title WIP: Fix udp hole punching Fix udp hole punching Jan 22, 2018
@ustulation ustulation merged commit abd249e into ustulation:master Jan 22, 2018
@povilasb povilasb deleted the fix/udp-hole-punching branch January 22, 2018 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants