Skip to content

Commit 7fa2bee

Browse files
lpincajasnell
authored andcommitted
doc: add documentation for the 'timeout' event
Adds the `'timeout'` event to the `http.ClientRequest` documentation. PR-URL: #15443 Fixes: #14856 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent d82ae0c commit 7fa2bee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/api/http.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,16 @@ added: v0.5.3
427427

428428
Emitted after a socket is assigned to this request.
429429

430+
### Event: 'timeout'
431+
<!-- YAML
432+
added: v0.7.8
433+
-->
434+
435+
Emitted when the underlying socket times out from inactivity. This only notifies
436+
that the socket has been idle. The request must be aborted manually.
437+
438+
See also: [`request.setTimeout()`][]
439+
430440
### Event: 'upgrade'
431441
<!-- YAML
432442
added: v0.1.94
@@ -1909,6 +1919,7 @@ const req = http.request(options, (res) => {
19091919
[`net.Socket`]: net.html#net_class_net_socket
19101920
[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener
19111921
[`request.end()`]: #http_request_end_data_encoding_callback
1922+
[`request.setTimeout()`]: #http_request_settimeout_timeout_callback
19121923
[`request.socket`]: #http_request_socket
19131924
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
19141925
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback

0 commit comments

Comments
 (0)