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

Add lossy mode #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add lossy mode #76

wants to merge 1 commit into from

Conversation

hizani
Copy link
Contributor

@hizani hizani commented May 18, 2024

This PR adds stateless lossy mode which is enabled by -l option.
Lossy mode server is compatible with lossless mode clients and vice versa.

I can't actually test it because -L option doesn't work in master build at the time the PR was created, but ping mode works fine.

Copy link

sonarcloud bot commented May 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@zoff99
Copy link

zoff99 commented May 18, 2024

@hizani
the first byte of data for tox custom packets is the packet ID. which is globally unique.
please register all IDs here:

https://github.com/zoff99/toxcore_custom_packets_registry

thank you.

@hizani
Copy link
Contributor Author

hizani commented May 18, 2024

@zoff99
Done. I've added only the lossless ID, because I don't know if this PR will ever be merged.

@gjedeer
Copy link
Owner

gjedeer commented May 21, 2024

@hizani Can you tell me the motivation for it? I thought about adding lossy packets in the far future, but for forwarding UDP.

TCP retransmission won't work at this level, so you'd just have incomplete TCP transmission if I understand correctly. Don't get me wrong, I'm not against merging this but please write why someone may need this.

@hizani
Copy link
Contributor Author

hizani commented May 21, 2024

@gjedeer The motivation is to reduce latency caused by waiting on SENDQ here. It can help latency-sensitive cases like device monitoring, multiplayer gaming etc.

As far as I understand it, lossy packets can work over TCP without problems but there won't be any ordering on the toxcore level.

@gjedeer
Copy link
Owner

gjedeer commented May 22, 2024

Let me know when you test it on a lossy network and get some of these messages in the log. I'm pretty sure any software working over TCP will not work correctly when it loses random part of the stream. One exception I can think of is maybe some video player like mpv or vlc, these can handle completely malformed input.

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