BitSharp.Network.ExtensionMethods.ExtensionMethods.ToIPEndPoint C# (CSharp) Method

ToIPEndPoint() public static method

public static ToIPEndPoint ( this networkAddress ) : IPEndPoint
networkAddress this
return System.Net.IPEndPoint
        public static IPEndPoint ToIPEndPoint(this NetworkAddress networkAddress)
        {
            var address = new IPAddress(networkAddress.IPv6Address.ToArray());
            if (address.IsIPv4MappedToIPv6)
                address = new IPAddress(networkAddress.IPv6Address.Skip(12).ToArray());

            return new IPEndPoint(address, networkAddress.Port);
        }
    }
ExtensionMethods