KCP
A fast and reliable ARQ protocol
... in the way of callback. Even the clock needs to be passed in from the outside, without any internal system calls. The entire protocol has only two source files of ikcp.h, ikcp.c, which can be easily integrated into the user's own protocol stack. You may have implement a P2P, or a UDP-based protocol, but are lack of a set of perfect ARQ reliable protocol implementation, then by simply copying the two files to the existing project, and writing a couple of lines of code, you can use it.