HTTP 客户端超时和服务器超时 [英] HTTP client timeout and server timeout

查看:45
本文介绍了HTTP 客户端超时和服务器超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个问题:哪里可以我找到了所有浏览器的默认超时设置?每个浏览器都有一个默认的超时设置

According to this question: Where can I find the default timeout settings for all browsers? each every browser has a default setting for time out

Firefox17 中的默认超时时间,经过检查about:config 是 115 秒.但是,我已经测试运行了一些我计时的请求,它在 >150~ 秒后返回了一个请求.

The default timeout in Firefox17, after checking about:config is 115s. However I have tested to run some request in which I timed and it returned a request after >150~ seconds.

所以我想知道它是如何工作的,Firefox 之前不是应该超时吗?

So I wonder how does it works, shouldn't Firefox have timed out before?

推荐答案

超时的形式有很多种,你是在连接超时之后,请求超时还是生存时间(TCP连接停止之前的时间).

There's many forms of timeout, are you after the connection timeout, request timeout or time to live (time before TCP connection stops).

Firefox 上的默认 TimeToLive 是 115 秒 (network.http.keep-alive.timeout)

The default TimeToLive on Firefox is 115s (network.http.keep-alive.timeout)

Firefox 上的默认连接超时为 250 秒 (network.http.connection-retry-timeout)

The default connection timeout on Firefox is 250s (network.http.connection-retry-timeout)

Firefox 的默认请求超时为 30 秒(network.http.pipelining.read-timeout).

The default request timeout for Firefox is 30s (network.http.pipelining.read-timeout).

执行 HttpRequest 所需的时间取决于是否建立了连接,这必须在 250 秒内,我猜你不会想要.您可能是在我认为是 30,000 毫秒(30 秒)的请求超时之后,所以总而言之,我会说它因连接超时而超时,这就是为什么您在大约 150 秒后收到回复的原因,尽管我还没有真正测试过这个.

The time it takes to do an HttpRequest depends on if a connection has been made this has to be within 250s which I'm guessing you're not after. You're probably after the request timeout which I think is 30,000ms (30s) so to conclude I'd say it's timing out with a connection time out that's why you got a response back after ~150s though I haven't really tested this.

这篇关于HTTP 客户端超时和服务器超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆