diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-07-17 23:55:45 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-07-23 17:02:35 +0200 |
commit | 0e4cbde13b9177075eaf86d96d8e26ac424a65df (patch) | |
tree | d10f3fa4bbe08eda198a1980852960adcc3d61eb /doc/api/http2.md | |
parent | daa15b54baf0815e555eecdd96c4205dea24a17f (diff) | |
download | android-node-v8-0e4cbde13b9177075eaf86d96d8e26ac424a65df.tar.gz android-node-v8-0e4cbde13b9177075eaf86d96d8e26ac424a65df.tar.bz2 android-node-v8-0e4cbde13b9177075eaf86d96d8e26ac424a65df.zip |
doc: document http2 network error behaviour
Fixes: https://github.com/nodejs/node/issues/21836
PR-URL: https://github.com/nodejs/node/pull/21861
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Diffstat (limited to 'doc/api/http2.md')
-rw-r--r-- | doc/api/http2.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md index 3a131c36a8..354877dba0 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -271,12 +271,17 @@ server.on('stream', (stream, headers) => { 'content-type': 'text/html', ':status': 200 }); + stream.on('error', (error) => console.error(error)); stream.end('<h1>Hello World</h1>'); }); server.listen(80); ``` +Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence, +a network error will destroy each individual stream and must be handled on the +stream level, as shown above. + #### Event: 'timeout' <!-- YAML added: v8.4.0 |