Skip to content

Commit 8a3b995

Browse files
author
kthrose
committed
fix async issue where same port is considered open
1 parent 38785f9 commit 8a3b995

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ElectronNET.Host/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ function startSocketApiBridge(port) {
9999
server.listen(port, 'localhost');
100100
server.on('listening', function () {
101101
console.log('Electron Socket started on port %s at %s', server.address().port, server.address().address);
102+
// Now that socket connection is established, we can guarantee port will not be open for portscanner
103+
startAspCoreBackend(port);
102104
});
103105

104-
startAspCoreBackend(port);
105-
106106
io.on('connection', (socket) => {
107107
global['electronsocket'] = socket;
108108
global['electronsocket'].setMaxListeners(0);

0 commit comments

Comments
 (0)