(ms?: number)
| 294 | } |
| 295 | |
| 296 | setMaintenanceTimeout(ms?: number) { |
| 297 | dbgMaintenance(`Set socket timeout to ${ms}`); |
| 298 | if (this.#maintenanceTimeout === ms) { |
| 299 | dbgMaintenance(`Socket already set maintenanceCommandTimeout to ${ms}, skipping`); |
| 300 | return; |
| 301 | }; |
| 302 | |
| 303 | this.#maintenanceTimeout = ms; |
| 304 | |
| 305 | if(ms !== undefined) { |
| 306 | this.#socket?.setTimeout(ms); |
| 307 | publish(CHANNELS.CONNECTION_RELAXED_TIMEOUT, () => ({ clientId: this.#clientId, value: 1 })); |
| 308 | } else { |
| 309 | this.#socket?.setTimeout(this.#socketTimeout ?? 0); |
| 310 | publish(CHANNELS.CONNECTION_RELAXED_TIMEOUT, () => ({ clientId: this.#clientId, value: -1 })); |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | async #createSocket(): Promise<net.Socket | tls.TLSSocket> { |
| 315 | const socket = this.#socketFactory.create(); |
no test coverage detected