瀏覽代碼

agreesively close unresponding connections

v2ray 9 年之前
父節點
當前提交
c5170a36f0
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      transport/internet/kcp/kcp.go

+ 4 - 0
transport/internet/kcp/kcp.go

@@ -377,6 +377,10 @@ func (kcp *KCP) flush() {
 	if kcp.state == StateTerminated {
 		return
 	}
+	if kcp.state == StateActive && _itimediff(kcp.current, kcp.lastIncomingTime) >= 30000 {
+		kcp.OnClose()
+	}
+
 	if kcp.state == StateTerminating {
 		kcp.output.Write(&CmdOnlySegment{
 			Conv: kcp.conv,