Starting work on Implementing SSH Server Service

This commit is contained in:
Raven Scott
2026-04-08 20:02:12 -04:00
parent ef14f23a10
commit 4757b2a4b0
219 changed files with 72548 additions and 518 deletions
@@ -0,0 +1,28 @@
// Test for thread-safety issues caused by subsequent imports of the module
// in worker threads: https://github.com/mscdex/ssh2/issues/1393.
// Each subsequent worker increases probability of abnormal termination.
// The probability of a false pass due to zero response becomes negligible
// for 4 consecutive workers.
'use strict'
try {
require('bare-process/global')
} catch {
/* Node.js */
}
let Worker, isMainThread
try {
;({ Worker, isMainThread } = require('worker_threads'))
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') throw e
process.exit(0)
}
require('../lib/index.js')
if (isMainThread) {
async function runWorker() {
return new Promise((r) => new Worker(__filename).on('exit', r))
}
runWorker().then(runWorker).then(runWorker).then(runWorker)
}