-
Notifications
You must be signed in to change notification settings - Fork 14
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 incorrect UDP packet truncation. Add TCP_NODELAY. #8
Conversation
不太可能出现大于1.5KB的udp报文的,按理来说程序会将超过MTU的udp包切片发送 |
@Itsusinn 是的,但是这个位置是拼接后的 |
啊?我再看看。 |
对的,不预分配可以用peek查询,效率没直接划个大池高 |
虽然这60k里有些稍后又释放了。 |
好像Rust的内存管理挺好的,我开了32个线程发UDP大包,内存稳定5MB,CPU也是0.5%,岿然不动,htop第一页都找不到 |
挺好,可能这个60k整体的存活时间不长。 |
Benchmark 代码 (问GPT要了一份)
|
Fix incorrect UDP packet truncation. Add TCP_NODELAY.
解决 UDP 包被截断的问题,可能解决了 #4 ,没有游戏无法证实,2k大小的UDP包通过ECHO SERVER测试,待确认。
TCPStream 增加 TCP_NODELAY
max_external_packet_size
服务端配置在本PR中被移除