doc: fix s/rstStream/close in example

PR-URL: https://github.com/nodejs/node/pull/18088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
James M Snell 2018-01-11 10:05:15 -08:00
parent 078b7a2a65
commit 47a282293f

View File

@ -1015,7 +1015,7 @@ const { NGHTTP2_CANCEL } = http2.constants;
const req = client.request({ ':path': '/' });
// Cancel the stream if there's no activity after 5 seconds
req.setTimeout(5000, () => req.rstStream(NGHTTP2_CANCEL));
req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));
```
#### http2stream.state