I obtain the same error, native program is in NodeJS language.
according to edge inspector, the stdout is perfectly similar to stdin message, which is received properly from the native app (different strings).
this is the “inspector” debug output:
data from extension to native app:
[39, 0, 0, 0, 34, 87, 72, 89, 32, 73, 84, 32, 68, 79, 69, 83, 78, 39, 84, 32, 87, 79, 82, 75, 32, 65, 83, 32, 69, 88, 80, 69, 67, 84, 69, 68, 32, 63, 63, 63, 63, 63, 34]
data sent from the native app to extension:
[39, 0, 0, 0, 34, 73, 32, 65, 77, 32, 83, 84, 82, 85, 71, 71, 76, 73, 78, 71, 32, 116, 111, 32, 115, 111, 108, 118, 101, 32, 116, 104, 105, 115, 32, 112, 114, 111, 98, 108, 101, 109, 34]
extension error:
Disconnected due to an error: Native application tried to send a message of 1394626127 bytes, which exceeds the limit of 1048576 bytes.
NodeJS function to send message from native app to extension:
let test = () => {
let jsonString = JSON.stringify("I AM STRUGGLING to solve this problem");
let jsonBuffer = Buffer.from(jsonString);
console.log("JSON BUFFER", jsonBuffer);
let lengthBuffer = Buffer.alloc(4);
lengthBuffer.writeUInt32LE(jsonBuffer.length);
console.log("LENGTH BUFFER", lengthBuffer);
let data = Buffer.concat([lengthBuffer, jsonBuffer]);
console.log("SENDING DATA", data);
process.stdout.write(data);
};
debug output (from NodeJS):
JSON BUFFER Buffer(39) [34, 73, 32, 65, 77, 32, 83, 84, 82, 85, 71, 71, 76, 73, 78, 71, 32, 116, 111, 32, 115, 111, 108, 118, 101, 32, 116, 104, 105, 115, 32, 112, 114, 111, 98, 108, 101, 109, 34]
LENGTH BUFFER Buffer(4) [39, 0, 0, 0]
SENDING DATA Buffer(43) [39, 0, 0, 0, 34, 73, 32, 65, 77, 32, 83, 84, 82, 85, 71, 71, 76, 73, 78, 71, 32, 116, 111, 32, 115, 111, 108, 118, 101, 32, 116, 104, 105, 115, 32, 112, 114, 111, 98, 108, 101, 109, 34]
I have also tried to reverse byte order, but another error arose: a “zero” value to stdout…
Any advise ?