KCP is an algorithmic transport protocol which provides reliability and sequencing for unreliable channels like UDP. By algorithmic it means it doesn’t care about sockets, and even clock has to be provided externally.

It uses fast acknowledgements and has basic congestion+flow control, has an overhead of 24 bytes per packet/ack, but survives bad network conditions much better than TCP and doesn’t require retransmitting all packets after the lost one, making it viable for realtime games.

Original code is written in C and hasn’t been updated for a while so I decided to bring my own spin. Also fixed several bugs in the meantime.

This is my personal project which is currently in active development, but it has passed internal tests in our team and is considered semi-ready for production use. Basic tests for sanity checks are included.