mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc: improve localWindowSize event descriptions
The documentation listed the wrong event to subscribe to when calling `localWindowSize`. Also properly point out the correct event for http2 clients. Fixes: https://github.com/nodejs/node/issues/51014 Refs: https://github.com/nodejs/node/issues/38426 PR-URL: https://github.com/nodejs/node/pull/51071 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
committed by
James M Snell
parent
6b530aee24
commit
f91ccf4c0d
@@ -611,13 +611,15 @@ const http2 = require('node:http2');
|
||||
|
||||
const server = http2.createServer();
|
||||
const expectedWindowSize = 2 ** 20;
|
||||
server.on('connect', (session) => {
|
||||
server.on('session', (session) => {
|
||||
|
||||
// Set local window size to be 2 ** 20
|
||||
session.setLocalWindowSize(expectedWindowSize);
|
||||
});
|
||||
```
|
||||
|
||||
For http2 clients the proper event is either `'connect'` or `'remoteSettings'`.
|
||||
|
||||
#### `http2session.setTimeout(msecs, callback)`
|
||||
|
||||
<!-- YAML
|
||||
|
||||
Reference in New Issue
Block a user