GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: document http2 network error behaviour · nodejs/node@c3d9000

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • http2.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/http2.md‎

Copy file name to clipboardExpand all lines: doc/api/http2.md
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,17 @@ server.on('stream', (stream, headers) => {
271271
'content-type': 'text/html',
272272
':status': 200
273273
});
274+
stream.on('error', (error) => console.error(error));
274275
stream.end('<h1>Hello World</h1>');
275276
});
276277

277278
server.listen(80);
278279
```
279280

281+
Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence,
282+
a network error will destroy each individual stream and must be handled on the
283+
stream level, as shown above.
284+
280285
#### Event: 'timeout'
281286
<!-- YAML
282287
added: v8.4.0

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.