#449·kcp

ikcp_send单次最大发送数据量

作者: xty438307820创建于 2025年10月13日更新于 2025年10月13日

When reading the source code, ikcp_send has a section:cpp if (count >= (int)IKCP_WND_RCV) return -2; Here, the maximum amount of data sent by a single ikcp_send is hard-coded as IKCP_WND_RCV * mss. Let's modify it to make it adapt to rcv_wnd, so that we can dynamically modify rcv_wnd to adjust the maximum packet size per single packet, as follows:cpp if (count >= (int)kcp->rcv_wnd) return -2; Will this have any impact? I actually tried it because the maximum frg is 255, and packets exceeding the maximum frg fragment will be automatically divided into multiple packets and sent out. I feel that if we can handle the problem of packet sticking, is there any other pitfall?

内容来源: skywind3000/kcp