From c5170a36f0f8d1c7d61a3e3cd4e8d31280dc2a27 Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 29 Jun 2016 13:42:11 +0200 Subject: [PATCH] agreesively close unresponding connections --- transport/internet/kcp/kcp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index 69e8a058..48598623 100644 --- a/transport/internet/kcp/kcp.go +++ b/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,