I'm having an issue where I'm unable to close the SSH connections properly and I have to restart my application for them to close. My code keeps the ssh connection live for the duration of the application. I ran into an issue before that the socket for the SSH connection because unwritable but even when I .connect() its still unwritable. I fixed this by exec a command on the ssh and waiting to see if it crashes.
here is my code for creating and maintaining the connections, I thought adding uniqueIDs would help because the connection that's there would have no ref and the gc would end it but it doesn't seem to work that way. I had a bunch of code here that's just me testing to see if it would remove the ref. but it doesn't.
this function gets executed every min to run the .exec("hostname") on the target computer to check if the socket is still writeable. If not it makes a new connection with the new ServerInfo.
The good news is no more than the required amount of SSH2Promises are being made. Its the SSHConnection class that isnt being stopped or ended?. Note: SSH2CONN is just a wrapper I made to do Logging.
I'm having an issue where I'm unable to close the SSH connections properly and I have to restart my application for them to close. My code keeps the ssh connection live for the duration of the application. I ran into an issue before that the socket for the SSH connection because unwritable but even when I .connect() its still unwritable. I fixed this by exec a command on the ssh and waiting to see if it crashes. here is my code for creating and maintaining the connections, I thought adding uniqueIDs would help because the connection that's there would have no ref and the gc would end it but it doesn't seem to work that way. I had a bunch of code here that's just me testing to see if it would remove the ref. but it doesn't.
this function gets executed every min to run the .exec("hostname") on the target computer to check if the socket is still writeable. If not it makes a new connection with the new ServerInfo.
The good news is no more than the required amount of SSH2Promises are being made. Its the SSHConnection class that isnt being stopped or ended?. Note: SSH2CONN is just a wrapper I made to do Logging.