(client, callback)
| 170 | } |
| 171 | |
| 172 | _remove(client, callback) { |
| 173 | const removed = removeWhere(this._idle, (item) => item.client === client) |
| 174 | |
| 175 | if (removed !== undefined) { |
| 176 | clearTimeout(removed.timeoutId) |
| 177 | } |
| 178 | |
| 179 | this._clients = this._clients.filter((c) => c !== client) |
| 180 | const context = this |
| 181 | client.end(() => { |
| 182 | context.emit('remove', client) |
| 183 | |
| 184 | if (typeof callback === 'function') { |
| 185 | callback() |
| 186 | } |
| 187 | }) |
| 188 | } |
| 189 | |
| 190 | connect(cb) { |
| 191 | if (this.ending) { |
no test coverage detected