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

Function socketFinished

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

Source from the content-addressed store, hash-verified

53
54// Create a session using a socket that has finished connecting
55function socketFinished(done) {
56 const socket = net.connect(443, 'google.com', () => {
57 http2.connect('https://google.com', { socket }, (clientSession) => {
58 let error = null;
59 const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });
60 req.on('error', (err) => {
61 error = err;
62 });
63 req.on('response', (_headers) => {
64 req.on('data', (_chunk) => { });
65 req.on('end', () => {
66 clientSession.close();
67 return done(error);
68 });
69 });
70 });
71 });
72}
73socketFinished(common.mustSucceed());

Callers 1

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…