我有一个用 c++ 编写的 OSX 应用程序(特别是使用 OpenFrameworks 构建的)和一个使用 nodejs 编写的服务器。
该应用程序跟踪在房间内徘徊的物体,我想以相对恒定的方式(每秒至少 3 次)向服务器发送有关该物体位置的信息。
据我所知,我要么需要一个具有最少设置开销的协议,要么需要能够打开我可以推送的持久连接。如果您看不出 - 我不是网络编程大师!有谁知道 Node.js 端和 C++ 端的库可以在没有 500 万秒延迟的情况下完成此任务?
I've got an OSX application written in c++ (in particular, built with OpenFrameworks) and a server written using nodejs.
The application tracks an object wandering around a room and I want to send information about the object's position to the server on a relatively constant (at least 3 times a second) basis.
From what I can tell I either need a protocol with minimal amounts of setup overhead, or the ability to open up a persistant connection that I can push to. In case you can't tell - I'm not a network programming guru! Does anyone know of libraries on either the node.js side and the C++ side that can accomplish this without a 5 million second latency?
发布评论
评论(1)
从 openFrameworks 方面,您有很多发送数据的可能性:
(鉴于当前的 OF 007)
如果它们满足您的需求,请查看以下示例:
对于node.js,只需定义一个基本套接字或类似的东西来处理请求
(从nods.js首页http://nodejs.org/)
From the openFrameworks side you have quite a bunch of possibilities to send data:
(Given current OF 007)
look at the following examples, if they fit your needs:
For node.js, just define a basic socket or something like that to handle the request
(pulled from the nods.js frontpage http://nodejs.org/)