MCPcopy
hub / github.com/di-sukharev/opencommit / incrementSockets

Method incrementSockets

out/cli.cjs:26001–26012  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

25999 // fake socket and adding it to `sockets[origin]` and incrementing
26000 // `totalSocketCount`.
26001 incrementSockets(name) {
26002 if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
26003 return null;
26004 }
26005 if (!this.sockets[name]) {
26006 this.sockets[name] = [];
26007 }
26008 const fakeSocket = new net3.Socket({ writable: false });
26009 this.sockets[name].push(fakeSocket);
26010 this.totalSocketCount++;
26011 return fakeSocket;
26012 }
26013 decrementSockets(name, socket) {
26014 if (!this.sockets[name] || socket === null) {
26015 return;

Callers 1

createSocketMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected