gpt4 book ai didi

java - HTTP BOSH 和 HTTP 流水线

转载 作者:可可西里 更新时间:2023-11-01 16:25:51 26 4
gpt4 key购买 nike

我对 HTTP BOSH 和 HTTP 流水线感到困惑。

BOSH 规范:http://xmpp.org/extensions/xep-0124.html

If the client needs to send some data to the connection manager then it simply sends a second request containing the data. Unfortunately most constrained clients do not support HTTP Pipelining (concurrent requests over a single connection), so the client typically needs to send the data over a second HTTP connection.

在这个规范中有很多关于 HTTP 流水线的信息,但是从 http://en.wikipedia.org/wiki/HTTP_pipelining

Non-idempotent methods like POST should not be pipelined.

在 BOSH 规范中:

All information is encoded in the body of standard HTTP POST requests and responses. Each HTTP body contains a single wrapper which encapsulates the XML elements being transferred (see Wrapper Element).

那么 HTTP 流水线如何与 HTTP BOSH 一起使用呢??

最佳答案

HTTP RFC

Clients SHOULD NOT pipeline requests using non-idempotent methods or non-idempotent sequences of methods (see section 9.1.2).

“不应该”在此上下文中具有 RFC 2119 给出的含义,即

This phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label

这意味着,一般来说,不建议将 HTTP 流水线与 POST 请求结合使用(这符合 RFC 2616's POST 的概念>);然而,HTTP 协议(protocol)实际上并没有禁止它。如果它实际上禁止这种行为,RFC 2616 将使用“不得”的语言。 BOSH 规范的作者做出判断,在 BOSH 的情况下,对流水线化 POST 请求没有不利影响。

关于java - HTTP BOSH 和 HTTP 流水线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11783217/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com