mirror of
https://github.com/zap-proto/cpp.git
synced 2026-10-30 15:05:47 +00:00
zap-proto/cpp shipped a README telling readers to run cmake, and no CMakeLists, no headers, no source. Every C++ service that needed ZAP therefore hand-wrote frame handling, and the copies drifted from each other and from the wire. So here is the thing itself: the message layer, the call envelope with promise pipelining, and the symmetric transport, behind one exported target zap::zap. The bytes are not asserted against themselves. Every KAT in the codec and rpc suites was printed by github.com/zap-proto/go and pinned here, which is the only kind of evidence that distinguishes agreeing with the wire from agreeing with yourself. That caught one real rule a hand-written port would miss and did: set_bytes must hold its payload until finish(), because the reference lays a list started afterwards down FIRST — same fields, different bytes, and on a chain that is a fork. The transport suite proves the protocol rather than the framing, and without a timer, because a timing-based proof of "in flight at once" is not a proof. Both peers' handlers park until the other's request has arrived, so the test only passes if one connection carried both directions at once. And no request is answered until all eight have arrived; they are then answered in reverse, with the first held back until the caller — which by then already holds the last one's answer — releases it. Streams (direction tags 3-5) are not here. An unknown tag ends the connection rather than being quietly ignored.