at main
4 folders
7 files
eio-net: add an adversarial/chaos wrapper for flows, datagrams, and nets
Protocol adapters (requests, h2, quic, ssh, ttrpc, tls, tcpcl, websocket) must survive a hostile or degraded network -- dribbled and coalesced reads, short and torn writes, a mid-stream reset, dropped or duplicated or reordered datagrams, a refused or slow connect, a keep-alive server that drops after N accepts. That fault-injecting socket belongs in one shared library, not duplicated per adapter, so it lives here beside eio-net.mem and reuses its in-memory transport.
Eio_net_chaos.{Flow,Datagram,Net} each wrap a base Eio resource and inject faults from an inspectable schedule -- either an exact per-call script or a seeded generator whose sequence is a pure function of the seed, so a fuzz run replays byte for byte and composes with Eio_mock.Backend's deadlock detector as a liveness oracle. Stalls yield cooperatively rather than block; a scripted EOF/reset surfaces as End_of_file or an Eio.Io error carrying a dedicated backend code.
eio-net.mem gains pipe, handing out a bare connected flow pair so the chaos layer (and any test) can wrap both ends without a listen/connect handshake.