-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http2 timeout documentation #22798
Http2 timeout documentation #22798
Changes from 6 commits
93a39e7
a47d0ab
8d409ce
f703eb0
30678e9
885ecf9
acda854
5ac898c
c749d6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1615,6 +1615,25 @@ 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.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 secure server requests, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
The given callback is registered as a listener on the 'timeout' event. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
In case of no callback were assigned, a new `ERR_INVALID_CALLBACK` | ||
error will be throw. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw -> thrown |
||
|
||
#### server.close([callback]) | ||
<!-- YAML | ||
|
@@ -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 | ||
|
@@ -1739,6 +1759,24 @@ negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler | |
receives the socket for handling. If no listener is registered for this event, | ||
the connection is terminated. See the [Compatibility API][]. | ||
|
||
#### 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 secure server requests, | ||
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
The given callback is registered as a listener on the 'timeout' event. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
In case of no callback were assigned, a new `ERR_INVALID_CALLBACK` | ||
error will be throw. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw -> thrown |
||
|
||
#### server.close([callback]) | ||
<!-- YAML | ||
added: v8.4.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section headings are ABC-sorted, so this and the next added headings need to be placed after the
#### server.close([callback])
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an error is thrown if no callback is assigned, should we make the
callback
parameter in both signatures mandatory?