diff options
Diffstat (limited to 'doc/api/http2.md')
-rw-r--r-- | doc/api/http2.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index 7a8abcf4b58..81d1c8fa8e0 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1604,6 +1604,7 @@ 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()`. +**Default:** 2 minutes. #### server.close([callback]) <!-- YAML @@ -1617,6 +1618,24 @@ 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. +#### server.setTimeout([msecs][, callback]) +<!-- YAML +added: v8.4.0 +--> + +* `msecs` {number} **Default:** `120000` (2 minutes) +* `callback` {Function} +* Returns: {Http2Server} + +Used to set the timeout value for http2 server requests, +and sets a callback function that is called when there is no activity +on the `Http2Server` after `msecs` milliseconds. + +The given callback is registered as a listener on the `'timeout'` event. + +In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK` +error will be thrown. + ### Class: Http2SecureServer <!-- YAML added: v8.4.0 @@ -1717,6 +1736,7 @@ 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 `http2secureServer.setTimeout()`. +**Default:** 2 minutes. #### Event: 'unknownProtocol' <!-- YAML @@ -1740,6 +1760,24 @@ 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. +#### server.setTimeout([msecs][, callback]) +<!-- YAML +added: v8.4.0 +--> + +* `msecs` {number} **Default:** `120000` (2 minutes) +* `callback` {Function} +* Returns: {Http2SecureServer} + +Used to set the timeout value for http2 secure server requests, +and sets a callback function that is called when there is no activity +on the `Http2SecureServer` after `msecs` milliseconds. + +The given callback is registered as a listener on the `'timeout'` event. + +In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK` +error will be thrown. + ### http2.createServer(options[, onRequestHandler]) <!-- YAML added: v8.4.0 |