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

Function onconnection

lib/internal/cluster/child.js:228–248  ·  view source on GitHub ↗
(message, handle)

Source from the content-addressed store, hash-verified

226
227// Round-robin connection.
228function onconnection(message, handle) {
229 const key = message.key;
230 const server = handles.get(key);
231 let accepted = server !== undefined;
232
233 if (accepted && server[owner_symbol]) {
234 const self = server[owner_symbol];
235 if (self.maxConnections != null &&
236 self._connections >= self.maxConnections &&
237 !self.dropMaxConnection) {
238 accepted = false;
239 }
240 }
241
242 send({ ack: message.seq, accepted });
243
244 if (accepted)
245 server.onconnection(0, handle);
246 else
247 handle.close();
248}
249
250function send(message, cb) {
251 return sendHelper(process, message, null, cb);

Callers 1

onmessageFunction · 0.70

Calls 3

sendFunction · 0.70
getMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…