System.Net.NetworkInformation.SystemNetworkInterface.GetBestInterfaceForAddress C# (CSharp) Метод

GetBestInterfaceForAddress() приватный статический Метод

private static GetBestInterfaceForAddress ( IPAddress addr ) : int
addr System.Net.IPAddress
Результат int
        private static int GetBestInterfaceForAddress(IPAddress addr)
        {
            int index;
            Internals.SocketAddress address = new Internals.SocketAddress(addr);
            int error = (int)Interop.IpHlpApi.GetBestInterfaceEx(address.Buffer, out index);
            if (error != 0)
            {
                throw new NetworkInformationException(error);
            }

            return index;
        }