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

Function connect

test/parallel/test-tls-ticket.js:126–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124 let left = servers.length;
125
126 function connect() {
127 s = tls.connect(shared.address().port, {
128 session: sess,
129 rejectUnauthorized: false
130 }, function() {
131 if (s.isSessionReused())
132 ticketLog.push(s.getTLSTicket().toString('hex'));
133 });
134 s.on('data', () => {
135 s.end();
136 });
137 s.on('close', function() {
138 if (--left === 0)
139 callback();
140 else
141 connect();
142 });
143 s.on('session', (session) => {
144 sess ||= session;
145 });
146 s.once('session', (session) => onNewSession(s, session));
147 s.once('session', () => ticketLog.push(s.getTLSTicket().toString('hex')));
148 }
149
150 connect();
151}

Calls 8

callbackFunction · 0.70
connectMethod · 0.65
addressMethod · 0.65
pushMethod · 0.45
toStringMethod · 0.45
onMethod · 0.45
endMethod · 0.45
onceMethod · 0.45

Tested by 7

testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56
testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…