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: fix udp socket create error #430

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

Conversation

hsqStephenZhang
Copy link

@hsqStephenZhang hsqStephenZhang commented Jan 25, 2025

background

in these #352 #102 issues, someone mentioned that the performance is pretty low at the master branch, i encountered the same situation at my desktop and vps, so i checked out the previous commits and located the root cause.

root cause

from commit 5a49e83, the hand-written udp socket was changed to socket2. but in peer.rs, the udp socket's creation method's argument was wrong.

fix

Changed the socket type from Type::STREAM to Type::DGRAM to correctly handle UDP connections.

tests

i have tested several commits's performance with iperf3. after the fix, the throughput was finally ok

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.

1 participant