# `HttpDouble.Connection`
[🔗](https://github.com/aszymanskiit/http_double/blob/main/lib/http_double/connection.ex#L1)

Per-client connection process.

Each accepted TCP socket is owned by a `HttpDouble.Connection` process,
which is responsible for:

  * reading bytes from the socket and buffering them
  * decoding HTTP/1.1 requests (including simple keep-alive)
  * sending requests to `HttpDouble.Server`
  * applying response specifications (including delays, timeouts, closes,
    partial/raw replies)

# `t`

```elixir
@type t() :: %HttpDouble.Connection{
  buffer: binary(),
  closed?: boolean(),
  conn_id: non_neg_integer() | nil,
  request_index: non_neg_integer(),
  server: pid() | nil,
  socket: port() | nil
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(pid(), port(), non_neg_integer()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
