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:
Davy Landman
2023-12-06 13:17:25 +01:00
committed by James M Snell
parent 6b530aee24
commit f91ccf4c0d

View File

@@ -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