1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-24 04:04:31 +00:00

1. Set upperbound on number of Windows WaitHandles

2. Fixed Windows_IPC to DisconnectNamedPipe() on connected handled when 'end' is called
3. Fixed Windispatch to terminate on when close is emitted
This commit is contained in:
Bryan Roe
2020-05-19 01:14:18 -07:00
parent f115066e68
commit eba7419fc9
5 changed files with 33 additions and 17 deletions

View File

@@ -160,6 +160,12 @@ function Promise(promiseFunc)
refTable[this._internal._hashCode()] = this._internal;
this._internal.once('settled', function () { refTable[this._hashCode()] = null; });
}
Object.defineProperty(this, "completed", {
get: function ()
{
return (this._internal.completed);
}
});
}
Promise.resolve = function resolve()

View File

@@ -137,6 +137,7 @@ function connect(ipc)
});
global.ipcClient = require('net').createConnection({ path: ipcPath }, function ()
{
this.on('close', function () { process.exit(); });
this.on('data', function (c)
{
var cLen = c.readUInt32LE(0);
@@ -165,6 +166,8 @@ function connect(ipc)
if (cLen < c.length) { this.unshift(c.slice(cLen)); }
});
});
global.ipcClient.on('error', function () { process.exit(); });
global.ipc2Client.on('error', function () { process.exit(); });
}
module.exports = { dispatch: dispatch, connect: connect };