如何使用boost创建简单的http服务器,能够接收数据、编辑和共享?

发布于 2024-10-01 18:18:47 字数 369 浏览 0 评论 0原文

因此,使用任何免费的开源跨平台库(如 boost)如何创建一个能够在一个 URL(如 http://adress:port/service1/write/<)上接收数据流(例如 mp3 帧流)的 Web 服务/code> 并能够将最新接收到的数据分享给 http://adress:port/service1/read/ 上的所有消费者,所以当然 mp3 只是打包流数据的一个示例 - 一般来说它可以是任何包装的东西。如何创建这样的东西?

一般来说,我诚实地试图了解如何使用 C++ 网络库 来做这样的事情,但对我来说还不清楚。

So using any free opensource cross platform library like boost how to create a web service capable of reciving a data stream (for example stream of mp3 frames) on one URL like http://adress:port/service1/write/ and capable of sharing latest recived data to all consumers on http://adress:port/service1/read/ so of course mp3 is just an example of packed stream-able data - generally it can be anything packed. How to create such thing?

Generaly I am honesly triing to understend how to do such thing with C++ Network Library but it is just quite unclear to me.

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

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

发布评论

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

评论(2

怎樣才叫好 2024-10-08 18:18:47

boost::asio 文档有四个完整的 HTTP 服务器实现示例,每个示例的线程架构略有不同。

http://www.boost.org/doc/libs /1_43_0/doc/html/boost_asio/examples.html

The boost::asio documentation has four examples of complete HTTP server implementations, each with a slightly different threading architecture.

http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/examples.html

泪痕残 2024-10-08 18:18:47

您没有说明要使用什么平台,但如果 Windows 是替代方案,则 Windows HTTP API 易于使用且性能出色。

http://msdn.microsoft.com/en-us /library/aa364510(VS.85).aspx

You do not say what platform to use, but if Windows is an alternative, the Windows HTTP API easy to use and a great performer.

http://msdn.microsoft.com/en-us/library/aa364510(VS.85).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文