always start server...

canary
Marcus 2021-04-01 01:22:48 -04:00
parent 37f041b3d8
commit 36e9acd7aa
1 changed files with 14 additions and 9 deletions

View File

@ -25,7 +25,20 @@ class Node extends EventEmitter {
// log.info('secured connection from ' + socket.remoteAddress);
// this.clients.push(socket);
// });
this.readyPromise = this.negotiatePort();
this.readyPromise = this.negotiatePort().then(this.startServer.bind(this));
}
startServer() {
console.log('creating server on port ' + this.port);
stp.createServer({
identity: this.identity,
port: this.port
}, (connection) => {
console.log('incomming connection...');
console.dir(connection);
})
}
async negotiatePort() {
@ -55,15 +68,7 @@ class Node extends EventEmitter {
}
}
console.log('creating server on port ' + this.port);
stp.createServer({
identity: this.identity,
port: this.port
}, (connection) => {
console.log('incomming connection...');
console.dir(connection);
})
// console.log(mappings, this.hash);
}