fix async issue where same port is considered open

This commit is contained in:
kthrose
2019-05-29 10:50:24 -04:00
parent 38785f9b18
commit 8a3b9951fa

View File

@@ -99,10 +99,10 @@ function startSocketApiBridge(port) {
server.listen(port, 'localhost');
server.on('listening', function () {
console.log('Electron Socket started on port %s at %s', server.address().port, server.address().address);
// Now that socket connection is established, we can guarantee port will not be open for portscanner
startAspCoreBackend(port);
});
startAspCoreBackend(port);
io.on('connection', (socket) => {
global['electronsocket'] = socket;
global['electronsocket'].setMaxListeners(0);