@@ -1544,6 +1544,18 @@ added: v8.4.0
15441544The ` 'timeout' ` event is emitted when there is no activity on the Server for
15451545a given number of milliseconds set using ` http2server.setTimeout() ` .
15461546
1547+ #### server.close([ callback] )
1548+ <!-- YAML
1549+ added: v8.4.0
1550+ -->
1551+ - ` callback ` {Function}
1552+
1553+ Stops the server from accepting new connections. See [ ` net.Server.close() ` ] [ ] .
1554+
1555+ Note that this is not analogous to restricting new requests since HTTP/2
1556+ connections are persistent. To achieve a similar graceful shutdown behavior,
1557+ consider also using [ ` http2session.close() ` ] on active sessions.
1558+
15471559### Class: Http2SecureServer
15481560<!-- YAML
15491561added: v8.4.0
@@ -1651,6 +1663,18 @@ negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler
16511663receives the socket for handling. If no listener is registered for this event,
16521664the connection is terminated. See the [ Compatibility API] [ ] .
16531665
1666+ #### server.close([ callback] )
1667+ <!-- YAML
1668+ added: v8.4.0
1669+ -->
1670+ - ` callback ` {Function}
1671+
1672+ Stops the server from accepting new connections. See [ ` tls.Server.close() ` ] [ ] .
1673+
1674+ Note that this is not analogous to restricting new requests since HTTP/2
1675+ connections are persistent. To achieve a similar graceful shutdown behavior,
1676+ consider also using [ ` http2session.close() ` ] on active sessions.
1677+
16541678### http2.createServer(options[ , onRequestHandler] )
16551679<!-- YAML
16561680added: v8.4.0
@@ -3108,7 +3132,9 @@ following additional properties:
31083132[ `http2.createSecureServer()` ] : #http2_http2_createsecureserver_options_onrequesthandler
31093133[ `http2.Server` ] : #http2_class_http2server
31103134[ `http2.createServer()` ] : #http2_http2_createserver_options_onrequesthandler
3135+ [ `http2session.close()` ] : #http2_http2session_close_callback
31113136[ `http2stream.pushStream()` ] : #http2_http2stream_pushstream_headers_options_callback
3137+ [ `net.Server.close()` ] : net.html#net_server_close_callback
31123138[ `net.Socket` ] : net.html#net_class_net_socket
31133139[ `net.Socket.prototype.ref` ] : net.html#net_socket_ref
31143140[ `net.Socket.prototype.unref` ] : net.html#net_socket_unref
@@ -3121,6 +3147,7 @@ following additional properties:
31213147[ `response.write(data, encoding)` ] : http.html#http_response_write_chunk_encoding_callback
31223148[ `response.writeContinue()` ] : #http2_response_writecontinue
31233149[ `response.writeHead()` ] : #http2_response_writehead_statuscode_statusmessage_headers
3150+ [ `tls.Server.close()` ] : tls.html#tls_server_close_callback
31243151[ `tls.TLSSocket` ] : tls.html#tls_class_tls_tlssocket
31253152[ `tls.connect()` ] : tls.html#tls_tls_connect_options_callback
31263153[ `tls.createServer()` ] : tls.html#tls_tls_createserver_options_secureconnectionlistener
0 commit comments