constructor(frontend) { process.title = 'ndb/ndd_service'; this._disconnectPromise = new Promise(resolve => process.once('disconnect', () => resolve(DebugState.PROCESS_DISCONNECT))); this._connected = new Set(); this._frontend = frontend; const pipePrefix = process.platform === 'win32' ? '\\\\.\\pipe\\' : os.tmpdir(); const pipeName = `node-ndb.${process.pid}.sock`; this._pipe = path.join(pipePrefix, pipeName); const server = net.createServer(socket => { socket.on('data', async d => { const runSession = await this._startSession(JSON.parse(d), frontend); socket.write('run'); runSession(); }); socket.on('error', e => caughtErrorDebug(e)); }).listen(this._pipe); server.unref(); }
function getPort (cb) { const server = net.createServer() server.unref() server.on('error', err => { cb(err, null) }) server.listen(0, () => { const port = server.address().port server.close(() => { cb(null, port) }) }) }
tt.pass('timeout executed') }) }).listen(0).unref()
tt.pass('timeout executed') }) }).listen(0).unref()