mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05: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:
1 parent
aaf710f535
commit
84127514ba
1 file changed
+3
-1
+3
-1
@@ -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