TcpStatistics.MaximumConnections 属性

定义

获取支持的传输控制协议 (TCP) 连接的最大数。

public:
 abstract property long MaximumConnections { long get(); };
public abstract long MaximumConnections { get; }
member this.MaximumConnections : int64
Public MustOverride ReadOnly Property MaximumConnections As Long

属性值

Int64 值,指定可支持的 TCP 连接的总数。

示例

下面的代码示例显示超时和最大连接信息。

void ShowTcpTimeouts()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   TcpStatistics ^ tcpstat = properties->GetTcpIPv4Statistics();
   Console::WriteLine( "  Minimum Transmission Timeout............. : {0}", 
      tcpstat->MinimumTransmissionTimeout );
   Console::WriteLine( "  Maximum Transmission Timeout............. : {0}", 
      tcpstat->MaximumTransmissionTimeout );
   Console::WriteLine( "  Maximum connections ............. : {0}", 
      tcpstat->MaximumConnections );
}
public static void ShowTcpTimeouts()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    TcpStatistics tcpstat = properties.GetTcpIPv4Statistics();

    Console.WriteLine("  Minimum Transmission Timeout............. : {0}",
        tcpstat.MinimumTransmissionTimeout);
    Console.WriteLine("  Maximum Transmission Timeout............. : {0}",
        tcpstat.MaximumTransmissionTimeout);
    Console.WriteLine("  Maximum connections ............. : {0}",
        tcpstat.MaximumConnections);
    Console.WriteLine();
}
Public Shared Sub ShowTcpTimeouts() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim tcpstat As TcpStatistics = properties.GetTcpIPv4Statistics()
    
    Console.WriteLine("  Minimum Transmission Timeout............. : {0}", tcpstat.MinimumTransmissionTimeout)
    Console.WriteLine("  Maximum Transmission Timeout............. : {0}", tcpstat.MaximumTransmissionTimeout)
    Console.WriteLine("  Maximum connections ............. : {0}", tcpstat.MaximumConnections)

End Sub

注解

如果最大连接数是动态的,则此属性返回 -1。

适用于