Skip to content

Commit 784cdad

Browse files
lpincaBridgeAR
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 15879ad commit 784cdad

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
@@ -1966,6 +1976,7 @@ const req = http.request(options, (res) => {
19661976
[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener
19671977
[`removeHeader(name)`]: #requestremoveheadername
19681978
[`request.end()`]: #http_request_end_data_encoding_callback
1979+
[`request.setTimeout()`]: #http_request_settimeout_timeout_callback
19691980
[`request.socket`]: #http_request_socket
19701981
[`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed
19711982
[`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback

0 commit comments

Comments
 (0)