使用 Java NIO 进行管道式 Http

发布于 2024-09-15 05:40:17 字数 391 浏览 5 评论 0原文

通过研究网络,我发现管道 HTTP 比排队或并行连接更快、更省电(特别是对于移动设备)。然而,一般图书馆的支持似乎很小。最近,广泛应用的 Apache HttpCore 项目通过其 NIO 模块获得了支持。

至少在维基百科和文档中的一些地方是这么说的。我的问题是,我无法找到任何有关如何使用它发送简单的管道请求的示例或教程。 HttpCore NIO 文档和 Google codesearch 都没有给我任何看起来像 Http 管道的东西。

您能给我一个简单的示例,说明如何使用此模块在管道中发送两个获取并响应两个答案吗?

Researching the web, I've found that pipelined HTTP is much faster and more power efficient (specially for mobile devices) than queued or parallel connections. The support from general libraries however seams to be small. Just recently has the widespread Apache HttpCore project gained support through its NIO module.

At least it says so on Wikipedia and a few places in the documentation. My problem is, that I have been unable to find any examples or tutorials on how to use this for sending simple piped requests. Neither the HttpCore NIO docs, nor Google codesearch has given me anything looking like Http pipelining.

Can you give me a simple example on how to use this module for sending two gets in a pipe and responding two their answer?

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

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

发布评论

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

评论(2

那些过往 2024-09-22 05:40:18

我会等到 Android 获得正确的内置实现。如果 Google 不费心去使用它,那么可能就不值得这么麻烦了。

I would wait till Android gets a proper implementation built in. If Google hasn't bothered using it, it might just not be worth all the trouble.

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