如何从Node JS向C ++代码发送消息

时间:2014-09-25 06:58:45

标签: javascript c++ node.js

我正在使用Node js运行C ++程序,C ++程序将在Linux中以一个进程ID启动。现在我想使用启动的进程ID从Node JS向C ++程序发送消息。

以下是从Node JS调用C ++的代码示例

childout = cp.spawn('/home/build/eth/eth',['-i'], function(error, stdout, stderr){
   console.log("stdout :: " +stdout);
   console.log("stderror :: " +stderr);
   console.log("error :: " +error);
});

上面的代码启动了C ++并具有进程ID。现在我需要使用此进程ID发送消息。

任何人都可以指导我如何完成这项任务吗?

0 个答案:

没有答案
相关问题