HTTP 서버의 두 수명

listener와 accepted connection이 서로 다른 자원을 소유한다.

Server runtime

ServerSocket

새 연결을 accept하고 shutdown이 닫는다.

Dispatcher

동시 처리와 포화 정책을 결정한다.

Connection task

한 Socket에서 요청을 하나 이상 처리한다.

Response writer

요청별 결과를 wire로 flush한다.

핵심: acceptor가 request body를 직접 읽지 않도록 역할을 인계한다.