agentleFS
CloudflareKnown publishercloudflare/quiche/tokio-quiche/src/quic/AGENTS.md

quiche / quic

AGENTS.md13k starsChanged 2 months agoBSD-2-ClauseView on GitHub

Async QUIC connection management. Splits socket into recv-half (one InboundPacketRouter task) and send-half (shared by many IoWorker tasks). Entrypoints: connect()/connect_with_config() for clients, start_listener() for servers. raw submodule bypasses the router for manual packet injection.

Trending

Less talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 2 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/quiche repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about cloudflare/quiche

The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 54

Talked about on Bluesky, GitHub and Hacker News (54 times).

On Bluesky · 27

22 more on Bluesky

On GitHub · 23

18 more on GitHub

The file

Files
AGENTS.md

tokio-quiche/src/quic/

OVERVIEW

Async QUIC connection management. Splits socket into recv-half (one InboundPacketRouter task) and send-half (shared by many IoWorker tasks). Entrypoints: connect()/connect_with_config() for clients, start_listener() for servers. raw submodule bypasses the router for manual packet injection.

STRUCTURE

mod.rs                        # Entrypoints: connect, connect_with_config, start_listener
raw.rs                        # wrap_quiche_conn(): bypass router, manual packet feed
hooks.rs                      # ConnectionHook trait (custom SslContextBuilder)
addr_validation_token.rs      # RETRY token generation/validation for server

connection/
  mod.rs                      # InitialQuicConnection, QuicConnection, ApplicationOverQuic trait
  error.rs                    # HandshakeError enum, make_handshake_result()
  id.rs                       # ConnectionIdGenerator trait, SimpleConnectionIdGenerator
  map.rs                      # ConnectionMap: BTreeMap<CidOwned, mpsc::Sender<Incoming>>

io/
  connection_stage.rs         # ConnectionStage trait + stages: Handshake, RunningApplication, Close
  worker.rs                   # IoWorker<Tx,M,S>: per-connection recv→process→send loop
  gso.rs                      # GSO/GRO send_to(), UDP_MAX_GSO_PACKET_SIZE
  utilization_estimator.rs    # BandwidthReporter for max bandwidth/loss tracking

router/
  mod.rs                      # InboundPacketRouter: Future, demux by DCID, ConnectionMapCommand
  acceptor.rs                 # ConnectionAcceptor: server-side InitialPacketHandler (RETRY flow)
  connector.rs                # ClientConnector: client-side InitialPacketHandler (handshake FSM)

WHERE TO LOOK

TaskFileSymbol/Line
Add application lifecycle callbackconnection/mod.rsApplicationOverQuic trait (~:663)
Add connection/path callbackhooks.rsConnectionHook trait
Connection state machineio/connection_stage.rsConnectionStage trait, Handshake/RunningApplication/Close
Worker main loopio/worker.rsIoWorker::work_loop() (~:216)
Packet routing/demuxrouter/mod.rsInboundPacketRouter::on_incoming() (~:229)
CID managementio/worker.rsfill_available_scids(), refresh_connection_ids()
Server accept flowrouter/acceptor.rsConnectionAcceptor::handle_initials()
Client connect flowrouter/connector.rsClientConnector::on_incoming()
Connection spawn pathconnection/mod.rsInitialQuicConnection::start() / handshake() / resume()
CID-to-connection mapconnection/map.rsConnectionMap (optimized CidOwned for v1 CIDs)
Raw/manual connectionsraw.rswrap_quiche_conn(), ConnCloseReceiver

ANTI-PATTERNS

  • InitialQuicConnection is #[must_use] -- dropping silently discards connection. Always call .start(), .handshake(), or .handshake_fut().
  • handshake() spawns with AbortOnDropHandle -- dropping the future kills the handshake task. Hold the handle.
  • fill_available_scids sends ConnectionMapCommand::MapCid to router -- silently fails if router channel dropped. Don't assume CID registration succeeded.
  • transmute of Instant in gso.rs -- fragile platform-dependent hack. Do not extend or replicate.
  • One client connection per socket -- connect() docs explicitly warn. Sharing socket loses packets.
  • #[cfg(feature = "zero-copy")] gates QuicheConnection type alias -- quiche::Connection<BufFactory> vs quiche::Connection. Check both paths when modifying connection creation.
  • wait_for_quiche returns TlsFail on gather error -- misleading sentinel error, don't propagate this pattern.

NOTES

  • IoWorker is generic: IoWorker<Tx, M, S: ConnectionStage>. Stage transitions consume the worker via From<IoWorker<..>> for IoWorkerParams<..> and construct a new IoWorker with the next stage.
  • select! in work_loop is biased -- timeout arm must stay first to prevent starvation.
  • IoWorker drains PathEvents and forwards them synchronously through ConnectionHook::on_path_event when a hook is configured; callbacks must not block.
  • ConnectionMap uses CidOwned::Optimized([u64; 3]) for v1 CIDs (<=20 bytes) to avoid heap allocation on lookup.
  • InboundPacketRouter implements Future directly (not async fn) -- polled as a spawned task.
  • short_dcid() fast-path extracts DCID from short header packets without full Header::from_slice.
  • Router tests are #[cfg(all(test, unix))] in router/mod.rs -- not Windows-compatible.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.