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

Function socketNotFinished

test/internet/test-http2-issue-32922.js:34–51  ·  view source on GitHub ↗
(done)

Source from the content-addressed store, hash-verified

32
33// Create a session using a socket that has not yet finished connecting
34function socketNotFinished(done) {
35 const socket2 = net.connect(443, 'google.com');
36 http2.connect('https://google.com', { socket2 }, (clientSession) => {
37 let error = null;
38 const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
39 req.on('error', (err) => {
40 error = err;
41 });
42 req.on('response', (_headers) => {
43 req.on('data', (_chunk) => { });
44 req.on('end', () => {
45 clientSession.close();
46 socket2.destroy();
47 return done(error);
48 });
49 });
50 });
51}
52socketNotFinished(common.mustSucceed());
53
54// Create a session using a socket that has finished connecting

Callers 1

Calls 6

doneFunction · 0.70
connectMethod · 0.65
requestMethod · 0.65
closeMethod · 0.65
onMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…