* Close a connection that has been idle for too long.
(key: string, entry: SSH2ConnectionEntry)
| 406 | * Close a connection that has been idle for too long. |
| 407 | */ |
| 408 | private closeIdleConnection(key: string, entry: SSH2ConnectionEntry): void { |
| 409 | // Verify this is still the active connection for this key |
| 410 | if (this.connections.get(key) !== entry) { |
| 411 | return; |
| 412 | } |
| 413 | |
| 414 | this.connections.delete(key); |
| 415 | |
| 416 | try { |
| 417 | entry.client.end(); |
| 418 | } catch { |
| 419 | // Ignore errors closing the connection |
| 420 | } |
| 421 | |
| 422 | if (entry.proxyProcess?.exitCode === null) { |
| 423 | try { |
| 424 | entry.proxyProcess.kill(); |
| 425 | } catch { |
| 426 | // Ignore errors killing proxy |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | private async connect( |
| 432 | config: SSHConnectionConfig, |
no test coverage detected