Destroy the server connection
()
| 254 | |
| 255 | /** Destroy the server connection */ |
| 256 | close(): void { |
| 257 | if (this.s.state === STATE_CLOSED) { |
| 258 | return; |
| 259 | } |
| 260 | |
| 261 | stateTransition(this, STATE_CLOSING); |
| 262 | |
| 263 | if (!this.loadBalanced) { |
| 264 | this.monitor?.close(); |
| 265 | } |
| 266 | |
| 267 | this.pool.close(); |
| 268 | stateTransition(this, STATE_CLOSED); |
| 269 | this.emit('closed'); |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * Immediately schedule monitoring of this server. If there already an attempt being made |