Skip to content
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

Closed
wants to merge 9 commits into from
Closed
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Sep 11, 2018

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]).

Copy link
Contributor

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?

<!-- 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http2 secure server -> http2 server

and sets a callback function that is called when there is no activity
on the Http2Server after `msecs` milliseconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Http2Server -> `Http2Server`.


The given callback is registered as a listener on the 'timeout' event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'timeout' -> `'timeout'`


In case of no callback were assigned, a new `ERR_INVALID_CALLBACK`
error will be throw.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw -> thrown


#### server.close([callback])
<!-- YAML
Expand Down Expand Up @@ -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
Expand All @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Http2SecureServer -> `Http2SecureServer`


The given callback is registered as a listener on the 'timeout' event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'timeout' -> `'timeout'`


In case of no callback were assigned, a new `ERR_INVALID_CALLBACK`
error will be throw.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw -> thrown


#### server.close([callback])
<!-- YAML
added: v8.4.0
Expand Down