diff options
author | Sagi Tsofan <sagitsofan@gmail.com> | 2018-09-11 01:14:10 +0300 |
---|---|---|
committer | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2018-09-13 18:39:55 +0300 |
commit | 19c0620dd65cf4f912a45ca28b56af3ad211ad44 (patch) | |
tree | 3112f3ced7207b9167ccea845f8a3bd985025f3f /doc/api/http2.md | |
parent | 466cda05484c612769effb8c61a9a8ea8379bef2 (diff) | |
download | android-node-v8-19c0620dd65cf4f912a45ca28b56af3ad211ad44.tar.gz android-node-v8-19c0620dd65cf4f912a45ca28b56af3ad211ad44.tar.bz2 android-node-v8-19c0620dd65cf4f912a45ca28b56af3ad211ad44.zip |
doc: document http2 timeouts
New default timeout values of "2 minutes" were added into documentation
inside 2 classes under "Event: 'timeout'":
1) Class: Http2SecureServer
2) Class: Http2Server
New sections for `.setTimeout()` method were added inside
`Http2SecureServer` & `Http2Server` docs.
PR-URL: https://github.com/nodejs/node/pull/22798
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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 fac5a5f23b..7aec57e111 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1615,6 +1615,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 @@ -1628,6 +1629,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 @@ -1728,6 +1747,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 @@ -1751,6 +1771,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 |