apache - 一段时间后使用 HTTP 连接的 FIN pkt

标签 apache http networking tcp client-server

打开了 2 个 TCP 连接: 1.正常连接(同时实现echo server,client)& 2.HTTP连接

在将 apache 作为服务器运行时使用 curl(已修改)实用程序打开 HTTP 连接,其中 curl 在连接建立后的一段时间内未发送 GET 请求。 对于连接建立后的正常连接,服务器正在等待来自客户端的请求。 但正如所观察到的,奇怪的是,在连接建立后的 HTTP 连接中,如果 GET 请求不是来自客户端(一段时间),服务器正在向客户端发送 FIN pkt 并关闭他的连接部分。 HTTP 客户端是否在初始连接后立即发送 GET 请求的强制条件。

最佳答案

Apache 有一个名为 Timeout 的参数。

它的手册页 ( Apache Core - Timeout Directive ) 指出:

The TimeOut directive defines the length of time Apache will wait for I/O in various circumstances:

  1. When reading data from the client, the length of time to wait for a TCP packet to arrive if the read buffer is empty.
  2. When writing data to the client, the length of time to wait for an acknowledgement of a packet if the send buffer is full.
  3. In mod_cgi, the length of time to wait for output from a CGI script.
  4. In mod_ext_filter, the length of time to wait for output from a filtering process.
  5. In mod_proxy, the default timeout value if ProxyTimeout is not configured.

我想你陷入了一号

编辑

我潜伏在 W3 HTTP 文档中,但没有发现超时。

但是进入第 8 章(连接)我发现:

8.1.4 Practical Considerations

服务器通常有一些超时值,超过该值它们将不再保持非事件连接。 (...) 持久连接的使用对客户端或服务器的超时长度(或存在)没有任何要求。

这听起来像是“每个服务器或客户端都可以自由选择关于非事件连接超时的行为”

关于apache - 一段时间后使用 HTTP 连接的 FIN pkt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14472868/

相关文章:

apache - 从 Laravel 4 URL 中删除 index.php 并将 www 重写为非 www

ruby-on-rails - 在 Rails 中通过 SSL 在 Internet Explorer 中下载文件

c - 在 C 中查找 Linux 上的子网掩码

java - 如何以编程方式获得链接速度?

javascript - 如何通过javascript下载pdf文件?

c# - 从安卓手机发送数据到电脑?

python - 配置 pgAdmin4 作为网页工作

wordpress - 如何防止EasyPHP DevServer 16为别名添加前缀 'edsa'

php - Apache/PHP 多次提供文件服务

http - gRPC 连接如何在 kubernetes 服务 ClusterIP 上工作