skywind3000/kcp ? reverse-engineered prompt
Reverse engineered prompt
Build me a small C library that gives UDP style apps a fast, reliable way to send data without using TCP.
I want it to work like a lightweight protocol layer that I can drop into an existing project. It should manage ordering, acknowledgements, retransmits, window handling, and packet fragmentation, while letting the app provide the actual network send function and the current time. Keep it simple to integrate, with a header and source file, plus a basic test and a tiny example showing how to create a session, feed incoming packets in, call an update loop, send data, and receive data on the other side.
Please make it feel optimized for low latency, with a normal mode and a faster mode I can tune with a few settings like interval, resend behavior, window size, and MTU. If you need to check any current details, look up the latest docs online first.
Are you gonna build this?
make sure you review the code using coderabbit