I am using chrome native messaging api to communicate between my chrome-extension and native-windows-app which is written in c++.
The connection establishes finely and data also gets exchanged. But the connection breaks after random number of calls are made from extension to the native-app.
I tried running native-app independently and it works fine when run in an infinite loop(no exceptions occur).
My native-app generates almost 300KB of data at first call(encode_frame()) and then consecutive calls(per 300 ms) are made that generate 0 to 300KB of data(encode_frame_difference()). Data is base64 encoded.
FYI: communication occur via stdin and stdout between native-app and extension.
The problem is I am not able to figure out why connection breaks after some time.
Here is the native-app code: windows-native-app-cpp
Here is the extension code: chrome-extension-js
Any help would be appreciated!
Thank you.
EDIT: Till now I have found out that there is problem with certain length of data I'm sending.
eg. If the JSON length is between 2560 and 2815, it stops working. while for JSON lengths like 2816 or 6656 it works.