Open jeffrson opened 5 years ago
BTW, I believe this is somehow related to 'ssh.close()' not really closing when called after connected the second time.
That's why I hesitate to report this fact as a new bug. What do you think?
There is a problem when closing the connection - the array deregister
is not cleared (or otherwise modified) upon close.
Then, in getSSHConnection
, the newly created sshConnection
is not registered at all, because isRegistered thinks, the connection had already been registered, because the "unique id" has not changed.
@sanketbajoria Would it be possible to fix it on short-term? I see three alternative solutions:
This doesn't fix the strange sequence of "beforedisconnect", though.
@jeffrson Thanks for reporting this. I will look into this. If you do find a solution. Please feel free to raise a PR
Is a fix for this coming? I've observed lots of weird behaviour around reconnects that seems to be related to the issues described here.
Any updates yet?
Here is a short test:
it results in
As you can see, there's no 'connect' after close. Furthermore, two 'connect' on the first try seem strange as well as the second 'beforedisconnect' after 'disconnect'.