public static StunAttribute BuildChangeAddress(IpFamily family, IPAddress ip, ushort port)
        {
            var length = family switch
            {
                IpFamily.IPv4 => 4,
                IpFamily.IPv6 => 16,
                _ => throw new ArgumentOutOfRangeException(nameof(family), family, null)
            };

            return(new StunAttribute
            {
                Type = AttributeType.ChangedAddress,
                Length = (ushort)(4 + length),
                Value = new ChangedAddressStunAttributeValue
                {
                    Family = family,
                    Address = ip,
                    Port = port
                }
            });
        }
Esempio n. 2
0
 public virtual ClusterRule WithIpFamily(IpFamily ipFamily)
 {
     this._ipFamily = ipFamily;
     return(this);
 }
Esempio n. 3
0
 public EnterpriseClusterIpFamilyIT(DiscoveryServiceType discoveryServiceFactory, IpFamily ipFamily, bool useWildcard) : base(discoveryServiceFactory, ipFamily, useWildcard)
 {
 }