如何将 HTTP 流服务器 APE(Ajax 推送引擎)连接到计算成本较高的服务器

发布于 2024-12-24 16:57:08 字数 1388 浏览 6 评论 0原文

我一直在研究 APE(Ajax 推送引擎 - http://www.ape-project.org/)几个星期了,我已经阅读了他们在网站上的所有文档。

APE 项目声称“实时数据流”,但我就是找不到一个很好的例子。我对他们的文档有点失望。

我在他们的网站上读到的可能的维基页面: http://www.ape-project.org/wiki/index.php /Tutorial:How_to_write_an_application_with_APE

但同样,它只有一些概念,没有详细信息。

经过一些谷歌搜索后,我开始感到更加沮丧。 没有对我的目的有价值的教程或示例

所以我把这个贴在这里。

基本上,我一直想做的是,HTTP 流服务器(计算成本非常高)仍然可以很好地扩展(100 或 200 个客户端)。要求:

  1. 使用 HTTP 协议(​​无 RTMP);
  2. 客户端将音频数据流式传输到服务器;
  3. 服务器接收音频数据,对其进行处理并将结果发送回客户端同时接收来自客户端的音频数据 客户;
  4. 音频数据的处理在C/C++ 库中完成;
  5. 服务器还能够几秒的音频数据到客户端,并且客户端可以在接收音频数据的同时播放音频 来自服务器的音频数据;
  6. 客户端和服务器之间应建立长期连接/会话,并断开连接(TimeOut 或 UserDisconnect) 应该被服务器检测到;

我的问题是:

  1. 我应该阅读哪些 APE 示例和教程来满足我的需求?
  2. 在哪里可以找到使用 APE HTTP Streaming 的好示例?
  3. 如何创建一个非常简单的 HTTP 流示例(服务器流)
  4. 如何在服务器端连接计算量大的 C/C++ 库
  5. 如何在服务器端维护每个客户端连接/会话的状态

如果有人知道我的要求或问题,请告诉我。

谢谢。

彼得

I've been studying the APE (Ajax Push Engine - http://www.ape-project.org/) for several weeks, and I have read all the documentation they have at the website.

The APE project claims "real-time data streaming", but I just cannot find a good example for that. I'm kind of frustrated with their documentation.

The possible wikipage I read at their website:
http://www.ape-project.org/wiki/index.php/Tutorial:How_to_write_an_application_with_APE

But again, it just has some concepts, not detailed info.

After doing some Google search, I started feeling more frustrated. No valuable tutorials or examples for my purpose.

So I'm posting this here.

Basically, what I've been wanting to do is, an HTTP streaming server (with very computation expensive) can still scale reasonably well (100 or 200 clients). Requirements:

  1. Use HTTP protocol (no RTMP);
  2. The client streams the audio data to the server;
  3. The server receives the audio data, processes it and sends the result back to the cient WHILE receiving the audio data from the
    client;
  4. The processing of the audio data is done in a C/C++ library;
  5. The server is also be able to stream several-second audio data to the client, and the client can play the audio WHILE receiving the
    audio data from the server;
  6. A long-lived connection/session should be made between a client and the server, and the disconnection (TimeOut or UserDisconnect)
    should be detected by the server;

My questions are:

  1. What APE examples and tutorials should I read to facilitate my needs?
  2. Where can I find a good example using APE HTTP Streaming?
  3. How can I create a very simple HTTP streaming example (server streams)?
  4. How can I hook up my computation-expensive C/C++ lib at the server side?
  5. How can I maintain the state of each client connection/session at the server side?

If anyone know any idea of my requirements or questions, please let me know.

Thanks.

Peter

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

靖瑶 2024-12-31 16:57:08

APE 用于交换 JSON 数据,而不是流数据。
因此,您必须找到一个解决方案,让您的标准 Web 服务器(运行您的库)接收并解析数据。
那么你可以用 APE 做的就是所谓的“内联推送”。这意味着,将数据从后端服务器发送到 APE 服务器,以便 APE 服务器可以将数据转发到客户端。

对于您的情况,我会定期让解析库向 APE 服务器发送状态更新,以便将其分发给客户端。

关于您的问题:

  1. http://www.ape-project.org/wiki /index.php/Libape-controller
  2. 无处 - 这不是为了
  3. 你选择的另一种服务器端编程语言
  4. 显然,取决于你的 Apache/Nginx 和服务器语言
  5. 这就是 APE 可以并且将会做的事情 - 如果你在服务器端进行所需的编程。您已经在我的博客上发表了评论,因此您可能已经看到 http://www. xosofox.de/2010/10/ape-user-handling/ - 这应该会给你一些提示。

tl;dr

  • 使用另一台服务器作为库的后端
  • 让库服务器通过内联推送向 APE 发送简短的状态更新,以便 APE 将其推送到
    客户

APE is meant for exchanging JSON data - not streamed data.
So, you must find a solution where your standard web server (running your lib) receives and parses the data.
What you can do with APE then is so called "inline push". This means, sending data from the backend server to the APE server so it can forward the data to the clients.

In your case, I would regularily have the parsing lib send a status update to the APE server so it can be distributed to the client.

Regarding your questions:

  1. http://www.ape-project.org/wiki/index.php/Libape-controller
  2. Nowhere - it is not meant for that
  3. With anothother server side programming language of your choice
  4. Obviously, depends on your Apache/Nginx and server language
  5. Thats something APE can and will do - if you do the required programming on the server side. You already commented on my blog, so you might have seen http://www.xosofox.de/2010/10/ape-user-handling/ - this should give you some hints.

tl;dr

  • Use another server as backend for the lib
  • Have the lib server send short status updates via inline push to APE so APE will push it to
    the client
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文