HttpDouble.Connection (http_double v1.0.0)

Copy Markdown View Source

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)

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

t()

@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
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(server, socket, conn_id)

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