Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ioStart() {
portscanner.checkPortStatusAsync(process.env.IOPORT, '127.0.0.1')
.then((status) => {
if (status === 'closed') {
// no poly socketIO server exists at port yet, start new
return polyIO.server({
port: process.env.IOPORT,
clientCount: CLIENT_COUNT,
debug: process.env['npm_config_debug']
})
} else {
return Promise.resolve()
}
})
.then(ioClient)
return (global.ioPromise || Promise.resolve()).delay(10)
}