在局域网内测试时,kcp丢包问题
The server and client run on the same local network. The client sends 33 packets per second, each of which is 14 bytes, and the server receives and immediately sends back a 14-byte packet. When there are few client connections, the delay of the received response packet is basically between 30 and 60 ms, which is considered normal. However, when the number of concurrent connections reaches 1000, the delay of the response packet can be more than 1 second. I used the same test program, but replaced the KCP protocol with the TCP protocol, and the other parameters remained the same. When there were 1000 connections, the delay of the response packet was stable at 30 ms. After tracing the cause, I found that it was due to UDP packet loss, but the local network should not lose packets, and the actual packet volume is not very large. TCP also does not have the problem of packet loss (if there is packet loss, the delay will be very high). I used your KCP code and KCP-go, and they all caused high delay due to packet loss. The test was conducted on Windows 10 and Windows 11 operating systems. What is the problem, and how can it be solved?
内容来源: skywind3000/kcp