简体   繁体   English

如何获取服务器上打开的HTTP连接的总数?

[英]How to get total number of open HTTP connections on a server?

I would like to get the total number of open HTTP (TCP port 80) connections that Windows is receiving at a given point in time. 我想获取Windows在给定的时间点收到的开放HTTP(TCP端口80)连接的总数。

Is there any way in .NET to obtain this? .NET中有什么方法可以做到这一点?

Do I need to somehow query IPGlobalProperties.GetActiveTcpConnections ? 我是否需要以某种方式查询IPGlobalProperties.GetActiveTcpConnections

Works for me: 为我工作:

var properties = IPGlobalProperties.GetIPGlobalProperties();
var httpConnections = (from connection in properties.GetActiveTcpConnections()
                       where connection.LocalEndPoint.Port == 80
                       select connection);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM