h1_listener (h1 v0.8.0)
View SourceHTTP/1.1 listener: owns the listen socket, supervises the acceptor pool, and tracks every accepted connection. Runs under h1_sup so the listener outlives the process that called h1:start_server/2.
Acceptors register each accepted connection-loop process ({h1_conn_started, Pid}); the loop registers its h1_connection once it is up ({h1_conn_up, LoopPid, ConnPid}). stop/2 is synchronous: it stops accepting, then closes every tracked connection before returning. stop_accepting/2 only closes the listen socket and acceptor pool, leaving established connections to finish (graceful drain).
Summary
Functions
Synchronously stop the listener: close the listen socket, the acceptor pool, and every accepted connection. Returns once all of them are closed (or if the listener is already gone).
Synchronously stop accepting new connections while leaving the established ones running. The listener stays alive to track them; a later stop/2 closes them.
Types
Functions
Synchronously stop the listener: close the listen socket, the acceptor pool, and every accepted connection. Returns once all of them are closed (or if the listener is already gone).
Synchronously stop accepting new connections while leaving the established ones running. The listener stays alive to track them; a later stop/2 closes them.