Added large I/O message support. (#95)

This commit is contained in:
Ravin Perera
2020-06-05 21:54:06 +05:30
committed by GitHub
parent 10374352c6
commit 3aed949032
12 changed files with 791 additions and 727 deletions

View File

@@ -13,9 +13,9 @@ fs.appendFileSync("exects.txt", "ts:" + hpargs.ts + "\n");
Object.keys(hpargs.usrfd).forEach(function (key, index) {
let userfds = hpargs.usrfd[key];
let userinput = fs.readFileSync(userfds[0], 'utf8');
if (userinput.length > 0) {
if (userfds[0] != -1) {
let userinput = fs.readFileSync(userfds[0], 'utf8');
// Append user input to a state file.
fs.appendFileSync("userinputs.txt", userinput + "\n");
fs.writeSync(userfds[1], "Echoing: " + userinput);

View File

@@ -13,9 +13,11 @@ fs.appendFileSync("exects.txt", "ts:" + hpargs.ts + "\n");
Object.keys(hpargs.usrfd).forEach(function (key, index) {
let userfds = hpargs.usrfd[key];
let fileContent = fs.readFileSync(userfds[0]);
if (fileContent.length > 0) {
if (userfds[0] != -1) {
let fileContent = fs.readFileSync(userfds[0]);
// Save the content into a new file.
var fileName = new Date().getTime().toString();
fs.writeFileSync(fileName, fileContent);

View File

@@ -51,12 +51,9 @@ function main() {
function create_input_container(inp) {
let hexInp = inp.toString('hex');
console.log("hex " + hexInp.length);
let inp_container = {
nonce: (new Date()).getTime().toString(),
input: hexInp,
input: inp.toString('hex'),
max_ledger_seqno: 9999999
}
let inp_container_bytes = JSON.stringify(inp_container);