java-Kcp
README in english
kcp implemented based on netty version (including implementation of fec function)
KCP is a fast and reliable protocol (rudp) based on UDP. It can reduce the average delay by 30%-40% and reduce the maximum delay by three times at the cost of wasting 10%-20% of bandwidth than TCP.
maven address:
< dependency >
< groupId >com.github.l42111996</ groupId >
< artifactId >kcp-base</ artifactId >
< version >1.6</ version >
</ dependency >
Usage methods and parameters
- Server side example
- Client instance
- best practices
- A lot of information
- Compatible with c#, java server, c# client
- Problems encountered
- Performance test results
- Compatible with kcp-go, including fec compatibility
compatibility:
- Compatible with c version kcp
- fec is implemented based on https://github.com/Backblaze/JavaReedSolomon
- Perfectly compatible C# version, https://github.com/l42111996/csharp-kcp, to quickly build game front-end and back-end network libraries
stability:
It is already a stable version. According to statistics, 5 to 10 online projects have been accessed, including products from Tencent, Kuaishou and other companies.
optimization:
- Event-driven, taking full advantage of multi-core
- Optimize fastack logic and reduce traffic by 10%
- Optimize the check function.
- Optimize collection iterators.
- Contains fec to reduce latency
- Comes with crc32 check
- Use the time wheel to optimize the CPU usage of a large number of connections
- Use directbuf and object pool, no gc pressure
- Added use of conv or ip+port to determine channel uniqueness. The game recommends using conv and tcp configuration. Related information
- When increasing game usage, 4G switching to wifi and other export IP changes will not cause the connection to be disconnected.
Related information
- https://github.com/skywind3000/kcp Original c version of kcp
- https://github.com/xtaci/kcp-go go version kcp, with a lot of optimizations
- https://github.com/Backblaze/JavaReedSolomon java versionfec
- https://github.com/LMAX-Exchange/disruptor High-performance inter-thread messaging library
- https://github.com/JCTools/JCTools High-performance concurrency library
- https://github.com/szhnet/kcp-netty java version of a kcp
- https://github.com/l42111996/csharp-kcp C# version kcp based on dotNetty, perfectly compatible
comminicate
QQ:526167774