MCPcopy Index your code
hub / github.com/nodejs/node / normalSession

Function normalSession

test/internet/test-http2-issue-32922.js:15–30  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

13
14// Create a normal session, as a control case
15function normalSession(cb) {
16 http2.connect('https://google.com', (clientSession) => {
17 let error = null;
18 const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
19 req.on('error', (err) => {
20 error = err;
21 });
22 req.on('response', (_headers) => {
23 req.on('data', (_chunk) => { });
24 req.on('end', () => {
25 clientSession.close();
26 return cb(error);
27 });
28 });
29 });
30}
31normalSession(common.mustSucceed());
32
33// Create a session using a socket that has not yet finished connecting

Callers 1

Calls 5

connectMethod · 0.65
requestMethod · 0.65
closeMethod · 0.65
cbFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected