Lesson 4.3
Keep-alive - the close decision
Why HTTP/1.1 leaves the socket open by default, how the parser computes a single close-or-keep verdict, and the frozen rule for which connection header a response emits.
What you will build
- State the keep-alive versus close default for HTTP/1.1 and HTTP/1.0 and how a connection header overrides each.
- Compute req._closeAfter in the parser at the moment the header block completes.
- Emit the connection header only when it carries information the client cannot assume.