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])