Files
zeekay 87c0cc5d41 The C++ SDK this repo has been describing
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.
2026-09-05 14:46:04 -07:00

27 lines
1.5 KiB
Plaintext

Copyright (C) 2025, Lux Industries Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.