Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify http2 server.close() behavior #28581

Merged
merged 1 commit into from
Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1749,11 +1749,14 @@ added: v8.4.0
-->
* `callback` {Function}

Stops the server from accepting new connections. See [`net.Server.close()`][].
Stops the server from establishing new sessions. This does not prevent new
request streams from being created due to the persistent nature of HTTP/2
sessions. To gracefully shut down the server, call [`http2session.close()`] on
all active sessions.

This is not analogous to restricting new requests since HTTP/2
connections are persistent. To achieve a similar graceful shutdown behavior,
consider also using [`http2session.close()`] on active sessions.
If `callback` is provided, it is not invoked until all active sessions have been
closed, although the server has already stopped allowing new sessions. See
[`net.Server.close()`][] for more details.

#### server.setTimeout([msecs][, callback])
<!-- YAML
Expand Down Expand Up @@ -1895,11 +1898,14 @@ added: v8.4.0
-->
* `callback` {Function}

Stops the server from accepting new connections. See [`tls.Server.close()`][].
Stops the server from establishing new sessions. This does not prevent new
request streams from being created due to the persistent nature of HTTP/2
sessions. To gracefully shut down the server, call [`http2session.close()`] on
all active sessions.

This is not analogous to restricting new requests since HTTP/2
connections are persistent. To achieve a similar graceful shutdown behavior,
consider also using [`http2session.close()`] on active sessions.
If `callback` is provided, it is not invoked until all active sessions have been
closed, although the server has already stopped allowing new sessions. See
[`tls.Server.close()`][] for more details.

#### server.setTimeout([msecs][, callback])
<!-- YAML
Expand Down