()
| 431 | } |
| 432 | |
| 433 | destroySocket() { |
| 434 | const wasReady = this.#isReady; |
| 435 | this.#isReady = false; |
| 436 | |
| 437 | if (this.#socket) { |
| 438 | this.#socket.destroy(); |
| 439 | this.#socket = undefined; |
| 440 | } |
| 441 | |
| 442 | publish(CHANNELS.CONNECTION_CLOSED, () => ({ clientId: this.#clientId, reason: 'application_close', wasConnected: wasReady })); |
| 443 | this.emit('end'); |
| 444 | } |
| 445 | |
| 446 | ref() { |
| 447 | this.#isSocketUnrefed = false; |