[orc-rt] Add SimpleRemoteCA, a SimpleRemote protocol base (#219093)
SimpleRemoteCA implements the transport-independent parts of the
SimpleRemote protocol: opcode and header validation, setup-message
encoding, hang-up encoding and decoding, pending-call tracking, and
completion of controller calls onto the Session::ControllerAccess
contract. Subclasses own wire framing and byte transport entirely --
they de-frame incoming messages and hand the header fields to
handleMessage, and build outgoing ones from the Opcode set and the
encode helpers.
Header validation rejects fields the protocol requires to be unset: a
Result may not carry a handler tag, a hang-up may not carry a sequence
number or tag. It does not interpret fields the protocol requires to be
present -- in particular a Call's handler tag is passed through as
given, since the executor's job is to jump where the controller tells it
to.
A hang-up carries a serialized Error giving the reason the session is
ending, matching the format SimpleRemoteEPC and SimpleRemoteEPCServer
use, so that an orderly disconnect is distinguishable from a peer that
vanished. A hang-up whose reason is a failure ends the session with that
reason rather than reporting a plain end-of-session.
SimpleRemoteCATest drives the protocol operations directly through a
capture-only test double and observes the results via a Session.