Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bae7c60

Browse filesBrowse files
sagitsofanBethGriggs
authored andcommitted
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. Backport-PR-URL: #22850 PR-URL: #22798 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 805bf40 commit bae7c60
Copy full SHA for bae7c60

File tree

Expand file treeCollapse file tree

1 file changed

+38
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+38
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/http2.md‎

Copy file name to clipboardExpand all lines: doc/api/http2.md
+38Lines changed: 38 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,7 @@ added: v8.4.0
16041604

16051605
The `'timeout'` event is emitted when there is no activity on the Server for
16061606
a given number of milliseconds set using `http2server.setTimeout()`.
1607+
**Default:** 2 minutes.
16071608

16081609
#### server.close([callback])
16091610
<!-- YAML
@@ -1617,6 +1618,24 @@ Note that this is not analogous to restricting new requests since HTTP/2
16171618
connections are persistent. To achieve a similar graceful shutdown behavior,
16181619
consider also using [`http2session.close()`] on active sessions.
16191620

1621+
#### server.setTimeout([msecs][, callback])
1622+
<!-- YAML
1623+
added: v8.4.0
1624+
-->
1625+
1626+
* `msecs` {number} **Default:** `120000` (2 minutes)
1627+
* `callback` {Function}
1628+
* Returns: {Http2Server}
1629+
1630+
Used to set the timeout value for http2 server requests,
1631+
and sets a callback function that is called when there is no activity
1632+
on the `Http2Server` after `msecs` milliseconds.
1633+
1634+
The given callback is registered as a listener on the `'timeout'` event.
1635+
1636+
In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK`
1637+
error will be thrown.
1638+
16201639
### Class: Http2SecureServer
16211640
<!-- YAML
16221641
added: v8.4.0
@@ -1717,6 +1736,7 @@ added: v8.4.0
17171736

17181737
The `'timeout'` event is emitted when there is no activity on the Server for
17191738
a given number of milliseconds set using `http2secureServer.setTimeout()`.
1739+
**Default:** 2 minutes.
17201740

17211741
#### Event: 'unknownProtocol'
17221742
<!-- YAML
@@ -1740,6 +1760,24 @@ Note that this is not analogous to restricting new requests since HTTP/2
17401760
connections are persistent. To achieve a similar graceful shutdown behavior,
17411761
consider also using [`http2session.close()`] on active sessions.
17421762

1763+
#### server.setTimeout([msecs][, callback])
1764+
<!-- YAML
1765+
added: v8.4.0
1766+
-->
1767+
1768+
* `msecs` {number} **Default:** `120000` (2 minutes)
1769+
* `callback` {Function}
1770+
* Returns: {Http2SecureServer}
1771+
1772+
Used to set the timeout value for http2 secure server requests,
1773+
and sets a callback function that is called when there is no activity
1774+
on the `Http2SecureServer` after `msecs` milliseconds.
1775+
1776+
The given callback is registered as a listener on the `'timeout'` event.
1777+
1778+
In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK`
1779+
error will be thrown.
1780+
17431781
### http2.createServer(options[, onRequestHandler])
17441782
<!-- YAML
17451783
added: v8.4.0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.