internal/aol/p3 is P3, the link layer under the AOL 3.0/4.0 client:
- Packets: Append writes them (length, CRC-16/ARC), Reader reads them,
passing over what isn't P3, telling a bad CRC or length apart so it can
be NAKed, and taking AOL 4.0's "**" in place of a CRC.
- Link, started by Serve on a connection: waits for the client's INIT and
acknowledges it (byte for byte as hosts that serve live clients do),
then DATA in order in and out, tx/rx 0x10-0x7F round the ring, a window
of 16, an ACK every 8 DATA or 200ms after a lone one unless a packet of
ours carries it, a NAK once for each gap or bad CRC, go-back-N resends
on NAK, heartbeats after 12 seconds unacknowledged and the link down
after 10, a new INIT starting the link over.
- ParseInit reads what the client says of itself; Sniff tells a P3
client's first packet; Token splits a DATA's token from its data.
Tested against a client scripted over a pipe (windows, NAKs, resends,
heartbeats, wrapping round the sequence numbers), under -race.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRm1WrfJdB863kw36V