doc: clarify http2 server.close() behavior

This commit is an attempt to clarify the behavior of HTTP2's
server.close() method. Specifically, this makes it more clear
that the server stops allowing new sessions although the
callback may not be invoked for some time due to previously
existing sessions.

PR-URL: https://github.com/nodejs/node/pull/28581
Fixes: https://github.com/nodejs/node/issues/28214
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
cjihrig authored and Michaël Zasso committed 2019-07-20 11:05:22 +02:00
1 parent 2205818cca
commit 6f3ebb8787
1 file changed
+14 -8
+14 -8
View File
@@ -1748,11 +1748,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
@@ -1893,11 +1896,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