MCluck90/simple-ssh — pull request #7 by ecogodi (2014-10-20 15:02:18+00:00)
Title: Added check for closed connection in ssh.reset() method

A trivial check to make sure the connection isn't already closed.

This fixes a weird behaviour we encountered: asynchronous code called in an exit function will be executed _after_ the exit function has finished, thus ssh.end() has been already called and the socket is present but closed. At that point calling ssh.reset() stalls forever because the connection will not emit a new 'close' event.