Rearchitected state sync with hpfs. (#96)

This commit is contained in:
Ravin Perera
2020-06-10 20:51:45 +05:30
committed by GitHub
parent 9ee09bebb7
commit b89dbe0a2c
32 changed files with 1383 additions and 867 deletions

View File

@@ -22,17 +22,17 @@ Object.keys(hpargs.usrfd).forEach(function (key, index) {
}
});
let nplinput = fs.readFileSync(hpargs.nplfd[0], 'utf8');
if (nplinput.length > 0) {
console.log("Input received from hp:");
if (hpargs.nplfd[0] != -1) {
let nplinput = fs.readFileSync(hpargs.nplfd[0], 'utf8');
console.log("Input received from peers:");
console.log(nplinput);
fs.writeSync(hpargs.nplfd[1], "Echoing: " + nplinput);
}
let hpinput = fs.readFileSync(hpargs.hpfd[0], 'utf8');
if (hpinput.length > 0) {
//console.log("Input received from hp:");
//console.log(hpinput);
if (hpargs.hpfd[0] != -1) {
let hpinput = fs.readFileSync(hpargs.hpfd[0], 'utf8');
console.log("Input received from hp:");
console.log(hpinput);
fs.writeSync(hpargs.hpfd[1], "Echoing: " + hpinput);
}