With DRAIN_WEBTRANSPORT_SESSION (0x78ae)
Promise sequence: wt.ready (t=0s) → wt.draining (t=1.0s) → wt.closed (t=5.0s)
Streams completed cleanly: 12 / 12
Aborted streams (RESET_STREAM): 0
v157 · webtransport draining
Inspect the wire-level HTTP/3 capsules on the extended CONNECT stream — DRAIN_WEBTRANSPORT_SESSION (0x78ae) versus CLOSE_WEBTRANSPORT_SESSION (0x2843) — and compare how the ready → draining → closed Promise lifecycle and in-flight stream failure counts change under varying server drain grace periods.
Adjust the drain grace period and in-flight stream duration below to see how DRAIN_WEBTRANSPORT_SESSION (0x78ae) prevents stream resets compared to an immediate CLOSE_WEBTRANSPORT_SESSION (0x2843).
DRAIN_WEBTRANSPORT_SESSION (0x78ae)Promise sequence: wt.ready (t=0s) → wt.draining (t=1.0s) → wt.closed (t=5.0s)
Streams completed cleanly: 12 / 12
Aborted streams (RESET_STREAM): 0
CLOSE_WEBTRANSPORT_SESSION (0x2843)Promise sequence: wt.ready (t=0s) → wt.draining (never resolves) → wt.closed (t=1.0s)
Streams completed cleanly: 0 / 12
Aborted streams (RESET_STREAM): 12
| Timestamp | HTTP/3 Control Stream Event | wt.ready |
wt.draining |
wt.closed |
Client Action |
|---|
// Observing all three lifecycle promises on a WebTransport instance:
const wt = new WebTransport("https://edge.example.com/session");
wt.ready.then(() => {
console.log("[t=0.0s] Extended CONNECT 200 OK; session ready");
});
if ("draining" in wt) {
wt.draining.then(() => {
console.log("[0x78ae] DRAIN_WEBTRANSPORT_SESSION received; draining");
});
}
wt.closed.then(({ closeCode, reason }) => {
console.log("[0x2843] CLOSE_WEBTRANSPORT_SESSION:", closeCode, reason);
});