@@ -1538,6 +1538,18 @@ added: v8.4.0
15381538The ` 'timeout' ` event is emitted when there is no activity on the Server for
15391539a given number of milliseconds set using ` http2server.setTimeout() ` .
15401540
1541+ #### server.close([ callback] )
1542+ <!-- YAML
1543+ added: v8.4.0
1544+ -->
1545+ - ` callback ` {Function}
1546+
1547+ Stops the server from accepting new connections. See [ ` net.Server.close() ` ] [ ] .
1548+
1549+ Note that this is not analogous to restricting new requests since HTTP/2
1550+ connections are persistent. To achieve a similar graceful shutdown behavior,
1551+ consider also using [ ` http2session.close() ` ] on active sessions.
1552+
15411553### Class: Http2SecureServer
15421554<!-- YAML
15431555added: v8.4.0
@@ -1645,6 +1657,18 @@ negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler
16451657receives the socket for handling. If no listener is registered for this event,
16461658the connection is terminated. See the [ Compatibility API] [ ] .
16471659
1660+ #### server.close([ callback] )
1661+ <!-- YAML
1662+ added: v8.4.0
1663+ -->
1664+ - ` callback ` {Function}
1665+
1666+ Stops the server from accepting new connections. See [ ` tls.Server.close() ` ] [ ] .
1667+
1668+ Note that this is not analogous to restricting new requests since HTTP/2
1669+ connections are persistent. To achieve a similar graceful shutdown behavior,
1670+ consider also using [ ` http2session.close() ` ] on active sessions.
1671+
16481672### http2.createServer(options[ , onRequestHandler] )
16491673<!-- YAML
16501674added: v8.4.0
@@ -3121,7 +3145,9 @@ following additional properties:
31213145[ `http2.createSecureServer()` ] : #http2_http2_createsecureserver_options_onrequesthandler
31223146[ `http2.Server` ] : #http2_class_http2server
31233147[ `http2.createServer()` ] : #http2_http2_createserver_options_onrequesthandler
3148+ [ `http2session.close()` ] : #http2_http2session_close_callback
31243149[ `http2stream.pushStream()` ] : #http2_http2stream_pushstream_headers_options_callback
3150+ [ `net.Server.close()` ] : net.html#net_server_close_callback
31253151[ `net.Socket` ] : net.html#net_class_net_socket
31263152[ `net.Socket.prototype.ref` ] : net.html#net_socket_ref
31273153[ `net.Socket.prototype.unref` ] : net.html#net_socket_unref
@@ -3134,6 +3160,7 @@ following additional properties:
31343160[ `response.write(data, encoding)` ] : http.html#http_response_write_chunk_encoding_callback
31353161[ `response.writeContinue()` ] : #http2_response_writecontinue
31363162[ `response.writeHead()` ] : #http2_response_writehead_statuscode_statusmessage_headers
3163+ [ `tls.Server.close()` ] : tls.html#tls_server_close_callback
31373164[ `tls.TLSSocket` ] : tls.html#tls_class_tls_tlssocket
31383165[ `tls.connect()` ] : tls.html#tls_tls_connect_options_callback
31393166[ `tls.createServer()` ] : tls.html#tls_tls_createserver_options_secureconnectionlistener
0 commit comments