Ejemplo n.º 1
0
        internal SystemTcpStatistics(AddressFamily family)
        {
            uint result = UnsafeNetInfoNativeMethods.GetTcpStatisticsEx(out stats, family);

            if (result != IpHelperErrors.Success)
            {
                throw new NetworkInformationException((int)result);
            }
        }
Ejemplo n.º 2
0
        internal SystemTcpStatistics(AddressFamily family)
        {
            uint tcpStatistics;

            if (!ComNetOS.IsPostWin2K)
            {
                if (family != AddressFamily.InterNetwork)
                {
                    throw new PlatformNotSupportedException(SR.GetString("WinXPRequired"));
                }
                tcpStatistics = UnsafeNetInfoNativeMethods.GetTcpStatistics(out this.stats);
            }
            else
            {
                tcpStatistics = UnsafeNetInfoNativeMethods.GetTcpStatisticsEx(out this.stats, family);
            }
            if (tcpStatistics != 0)
            {
                throw new NetworkInformationException((int)tcpStatistics);
            }
        }