From e54078681a01ab23b2d71762bf59e418f6deb80b Mon Sep 17 00:00:00 2001 From: Chris Miller Date: Wed, 4 Apr 2018 13:32:18 +0100 Subject: [PATCH] doc, http2: add sections for server.close() and note to clarify behavior Clarify current behavior of http2server.close() and http2secureServer.close() w.r.t. perceived differences when compared with httpServer.close(). Fixes: https://github.com/nodejs/node/issues/19711 --- doc/api/http2.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 094dca2582fd92..6eea4d8f0b98c6 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1538,6 +1538,18 @@ added: v8.4.0 The `'timeout'` event is emitted when there is no activity on the Server for a given number of milliseconds set using `http2server.setTimeout()`. +#### server.close([callback]) + +- `callback` {Function} + +Stops the server from accepting new connections. See [`net.Server.close()`][]. + +Note that 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. + ### Class: Http2SecureServer +- `callback` {Function} + +Stops the server from accepting new connections. See [`tls.Server.close()`][]. + +Note that 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. + ### http2.createServer(options[, onRequestHandler])