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

Function onsecureConnect

test/async-hooks/test-tlswrap.js:74–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74function onsecureConnect() {
75 //
76 // Client connected to server
77 //
78 checkInvocations(svr, { init: 1, before: 2, after: 1 },
79 'server: when client connected');
80 checkInvocations(client, { init: 1, before: 2, after: 2 },
81 'client: when client connected');
82
83 //
84 // Destroying client socket
85 //
86 this.destroy(); // This destroys client before server handshakes, with TLS1.3
87 checkInvocations(svr, { init: 1, before: 2, after: 1 },
88 'server: when destroying client');
89 checkInvocations(client, { init: 1, before: 2, after: 2 },
90 'client: when destroying client');
91
92 tick(5, tick1);
93 function tick1() {
94 checkInvocations(svr, { init: 1, before: 2, after: 2 },
95 'server: when client destroyed');
96 // TODO: why is client not destroyed here even after 5 ticks?
97 // or could it be that it isn't actually destroyed until
98 // the server is closed?
99 if (client.before.length < 3) {
100 tick(5, tick1);
101 return;
102 }
103 checkInvocations(client, { init: 1, before: 3, after: 3 },
104 'client: when client destroyed');
105 //
106 // Closing server
107 //
108 server.close(common.mustCall(onserverClosed));
109 // No changes to invocations until server actually closed below
110 checkInvocations(svr, { init: 1, before: 2, after: 2 },
111 'server: when closing server');
112 checkInvocations(client, { init: 1, before: 3, after: 3 },
113 'client: when closing server');
114 }
115}
116
117function onserverClosed() {
118 //

Callers

nothing calls this directly

Calls 2

tickFunction · 0.50
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…