- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
当FIN_WAIT2时间用完,最后一个FIN还没有从另一边传来时,active closer的下一个状态是什么? TIME-WAIT
或 CLOSED
?
我们知道在linux系统中,可以在文件/proc/sys/net/ipv4/tcp_fin_timeout: man tcp(7)中设置FIN-WAIT-2
tcp_fin_timeout (integer; default: 60; since Linux 2.2)
This specifies how many seconds to wait for a final FIN packet before the socket is forcibly closed. This is strictly a violation of the TCP specification, but required to prevent denial-of-service attacks. In Linux 2.2, the default value was 180.
TCP_LINGER2(自 Linux 2.4 起)
The lifetime of orphaned FIN_WAIT2 state sockets.This option can be used to override the system-wide setting in the file /proc/sys/net/ipv4/tcp_fin_timeout for this socket. This is not to be confused with the socket(7) level option SO_LINGER. This option should not be used in code intended to be portable.
我不太确定这个 TCP 套接字在 FIN_WAIT2
时间用完后会进入什么状态,强行关闭,转移到关闭
?或者只是跳入 TIME-WAIT
状态?
我做了一个测试:
1 : echo 3 > /proc/sys/net/ipv4/tcp_fin_timeout
2 : benchmark the tomcat runs on the linux
原来在netstat
中出现了很多TIME-WAIT
,而且还在不断累积,是不是意味着FIN_WAIT2
时间用完了,套接字跳入TIME-WAIT
?
还有一个问题:我改变了这个:echo 1 >/proc/sys/net/ipv4/tcp_tw_reuse
正如其他人所说:“重用套接字”,并保持 tcp_fin_timeout:3
。但什么都没有改变,TIME-WAIT
只是在累积。 tcp_tw_reuse
与处于TIME-WAIT
状态的套接字无关,TIME-WAIT
套接字不能被重用?
echo 1 >/proc/sys/net/ipv4/tcp_tw_recycle
似乎可以减少TIME-WAIT
计数,并保持低水平,留下单独的负载平衡问题。
最佳答案
如果您查看 TCP/IP state diagram , FIN_WAIT_2
转换为 TIME_WAIT
。所以我想当 FIN_WAIT_2
超时而 FIN
没有到达时,Linux 会简单地转换。
关于sockets - 当 FIN-WAIT-2 时间用完时,主动关闭器将进入什么状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25621622/
while(fin >> a) 或 while(fin.eof()) 不会工作。在第一种情况下,fin 流变量一直将文件中的最后一个字符作为输入。 我的输入文件是这样的: ab5c71,lj4j6v7
我正在研究如何使用 python 套接字发送 TCP FIN。 我尝试使用 socket.socket.close 并发出 TCP RST 而不是 TCP FIN。有人可以让我知道API是什么吗? 最
我有一个关于在 C++ 中正确使用 fin 和循环的问题。我有一个文件,我从中读取了 78 行数据,其中包括滑雪胜地名称、海拔高度,然后是 12 个数字,即每月降水量。该程序应该从该文件中读取,然后将
谁能提供一种算法来验证新加坡 FIN? 我知道新加坡的 NRIC 我可以通过模 11 验证它,然后将结果与查找表进行比较,但找不到 FIN 的类似查找表。 我也不确定模 11 是否是正确的验证方法。
我必须在两种情况下测试我的应用程序......即 1.连接发起者从服务器接收FIN 2.连接发起者向服务器发送FIN 我有 www 服务器作为服务器,windows 虚拟机作为客户端。我在 80 上做
在浏览开源代码库时,我想到了一个有趣的场景。假设在成功建立 TCP 连接后,TCP 客户端必须发送一个序列号 = 101 的数据包。相反,它发送一个序列号为 201 的 FIN。现在 TCP 服务器认
在 Clojure 中 Koans :fin 用于atoms.clj。这是一个例子: (def atomic-clock (atom 0)) "Atomic atoms are atomic"
我正在研究一些从文件读取信息并将其存储在结构中的代码。它正在处理我扔给它的所有文件,除了一个文件外,其中有许多其他错误。 如果文件中有错误,它将跳过其后的一行,但我不确定为什么。我的代码如下: voi
我已经定义了一个运算符,+-(忽略这个可怕的名字),如下: infixr 10 +- (+-) : Fin (S n) -> Fin (S m) -> Fin (S (n + m)) (+-) {n}
我正在尝试加载文件,但无法获取它。这是命令.. void Apple::loadDictionary(std::vector& ret) { std::ifstream fin("words");
我正在 Linux 下测试 SSH 连接。 通过使用 tcpdump,我注意到在常见的 SSH 数据包数据中设置了 TCP FIN 标志。出于测试目的,我想实现将带有 TCP FIN 标志的数据包作为
当 TCP 应用程序退出时,它会发送一个 FIN 数据包。 考虑一个连接到始终监听的服务器(服务器从不退出)的 tcp 客户端。 如果tcp客户端在几次数据包交换后突然退出,它是否总是向服务器发送FI
我有以下 Java 代码: Socket s = new Socket(); s.connect(mySockAddr, myTimeout); 假设我不使用套接字,我需要在服务器端连接关闭时检测到它
我正在尝试弄清楚如何实现优雅的断开连接(4 次握手)。 首先,我使用以下代码发送一个 FIN 数据包: shutdown(socket, SD_SEND); 这将导致发送套接字发送流被关闭。现在当对方
我已经编写了一个创建套接字的 C 代码,到目前为止它运行良好。在 TCP 的 RFC 中,我发现可以发送一个 FIN 标志来告诉其他主机我想退出或对话。 FIN 标志并不意味着其他主机无法发送更多数据
我想检查新加坡的 NRIC/FIN 用户输入数据是否正确。 [A-Z] [0-9]{7} [A-Z] 是正确的正则表达式吗?我是否需要检查第一个字符是 S/F/T/G?如果我需要检查其他情况,请告诉我
我们可以像这样枚举列表的元素: -- enumerate-ℕ = zip [0..] enumerate-ℕ : ∀ {α} {A : Set α} -> List A -> List (ℕ × A)
我有一个 azure 的VM,它充当TCP服务器(监听端口的java程序)。 TCP 客户端 (ncat) 位于公司网络中。中间有一个公司防火墙。客户端通过发送消息来发起与服务器的连接,之后服务器保持
我一直在使用org.apache.commons.net.telnet连接到控制流并向摄像头发送命令。我发送数据流请求并打开一个新线程,该线程从相机传感器扫描图像并将数据作为原始字节发送给我。我正在使
当尝试在 Idris 上实现 mod : Nat -> (m : Nat) -> Fin m 函数时,我注意到明显的算法不起作用,因为在循环和增加时结果, idris 不会相信它还在射程之内。这个片段
我是一名优秀的程序员,十分优秀!