New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the retry count? #69
Comments
Related to #23 The reason I couldn't find a way was because of how the event emitter does not reregister events when it creates the new connection using the retry logic. I couldn't find/see a way around this, the sshConnection.ts class to callback to the index.ts to close the connection, remove the event listeners and then reattach them for when it creates the new connection in the retry logic here ssh2-promise/src/sshConnection.ts Line 280 in 5e3674d
I am disabling the retry logic, forking this repo and then adding a ssh2-promise/src/sshConnection.ts Line 286 in 5e3674d
This closes the connection but still non of the original events are fired, but in my use case that monitors the local ports this is fine. As soon as I see the port is available and my program thinks it is in use, then I know something closed it and I must retry. |
…bajoria#69 - Add this.close() after connection could not be retried - Commit the generated JS files because will install direct from GitHub sanketbajoria#69
My application requires knowledge of when a SSH Connection + Tunnels are retrying.
The close and disconnect events do not fire and I have spent a lot of time trying to figure out how to get either an event or a flag by inspecting private variables on the class. But it shows connected every time. My procedure:
If anyone has any advice or help, would be much appreciated.
The text was updated successfully, but these errors were encountered: