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

Method add

lib/internal/socket_list.js:96–105  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

94 }
95
96 add(obj) {
97 this.connections++;
98
99 // Notify the previous owner of the socket about its state change
100 obj.socket.once('close', () => {
101 this.connections--;
102
103 if (this.connections === 0) this.emit('empty', this);
104 });
105 }
106}
107
108module.exports = { SocketListSend, SocketListReceive };

Callers

nothing calls this directly

Calls 2

onceMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected