Skip to content

Commit

Permalink
fix: 连接数不计入关闭的连接
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed Jul 9, 2024
1 parent b962b49 commit f8b5963
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public int Connections
IPGlobalProperties properti = IPGlobalProperties.GetIPGlobalProperties();
var tcps = properti.GetActiveTcpConnections();

var list = tcps.Where(f => f.LocalEndPoint.Port == ClusterRequiredData.Config.PORT);
var list = tcps.Where(f => f.LocalEndPoint.Port == ClusterRequiredData.Config.PORT && f.State == TcpState.Established);

var iplist = list.GroupBy(f => f.RemoteEndPoint.Address);
return iplist.Count();
Expand Down

0 comments on commit f8b5963

Please sign in to comment.