* Resets the Connection to its initial state.
()
| 1005 | * Resets the Connection to its initial state. |
| 1006 | */ |
| 1007 | async reset() { |
| 1008 | // Reset the internal state of the ControlConnection for future initialization attempts |
| 1009 | const currentHosts = this.hosts.clear(); |
| 1010 | |
| 1011 | // Set the shutting down flag temporarily to avoid reconnects. |
| 1012 | this._isShuttingDown = true; |
| 1013 | |
| 1014 | // Shutdown all individual pools, ignoring any shutdown error |
| 1015 | await Promise.all(currentHosts.map(h => h.shutdown())); |
| 1016 | |
| 1017 | this.initialized = false; |
| 1018 | this._isShuttingDown = false; |
| 1019 | } |
| 1020 | |
| 1021 | /** |
| 1022 | * Gets a Map containing the original contact points and the addresses that each one resolved to. |