always start server...
parent
37f041b3d8
commit
36e9acd7aa
23
lib/node.js
23
lib/node.js
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue