Nodejs communicate with C++ program?

前端 未结 3 1956
闹比i
闹比i 2021-02-05 13:46

Say I\'ve got a c++ program running on the same server with a Node.js web app, on a linux server.

The c++ program maintains a queue, and what I want to do with Node.js i

3条回答
  •  醉话见心
    2021-02-05 14:15

    If you're using Linux, I would suggest UNIX-domain sockets. They basically give you the high-performance of IPC using the BSD socket interface, making it easy to switch for TCP sockets later if you need to move the C++ (or node.js) application to a different computer.

    They're already supported by node.js and only the code that opens the socket will need to be changed. Many applications, including MySQL easily abstract this away in a configuration file.

提交回复
热议问题