| 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; |