ASGI consists of two different components: A protocol server, which terminates sockets and translates them into connections and per-connection event messages. An application, which lives inside a protocol server, is called once per connection, and handles event messages as they happen, emitting its own event messages back when necessary.