Ad

How To Shut Down `ssh2` Sftp Server Programatically

- 1 answer

I am using the ssh2 library to create a sftp server for testing during my testing suite. The server starts successfully and tests run as expected - all is great.

However, after all of the tests have been conducted the testing script does not exit as the sftp server process is still listening/executing.

How can I programatically shut down the sftp server?

Ad

Answer

From the docs:

Server instances also have the same methods/properties/events as net.Server.

These look promising:

Ad
source: stackoverflow.com
Ad