Libkcp
FEC enhanced KCP session library for iOS/Android in C++
Install / Use
/learn @xtaci/LibkcpREADME
libkcp
FEC enhanced KCP client session library for iOS/Android, compatible with kcp-go.
<img src="logo.png" alt="libkcp" height="300px" />Features
- Optimized for Online Games.
- Stream based interface, you can easily switch from your TCP based protocol to libkcp or dualstack.
- FEC(Forward Error Correction) Support with Reed-Solomon Codes
Usage
libkcp has been designed as a Frame-Driven library, the main loop was supposed as:
GameInit()
NetworkInit()
While (!isGameOver) Do // e.g: A 30FPS Game
LibKCP.Read()
LibKCP.Write()
LibKCP.Update()
Game.Logic()
Game.Render()
Wait(33ms) // clock
End
The Read/Write/Update functions of libkcp are guaranteed to be non-blocking.
Please read kcp_test.cpp fec_test.cpp for library usage.
Demo
start echo server(golang)
$go get github.com/xtaci/kcp-go
$go run kcpserver.go
compile and run libkcp(Best with CLion), and watch output.
Caveats
- Packet level encryption has not been implemented yet.
Troubleshooting
- C++11 is required for compiling.
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
