(obj)
| 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 | |
| 108 | module.exports = { SocketListSend, SocketListReceive }; |