Exemplo n.º 1
0
        public IConnection BuildMulticastConnection(INode bindNode, INode multicastNode)
        {
            if (MulticastHelper.IsValidMulticastAddress(multicastNode.Host))
            {
                return(new MulticastUdpConnection(EventLoopFactory.CreateNetworkEventLoop(), bindNode, multicastNode, Encoders.DefaultEncoder, Encoders.DefaultDecoder, UnpooledByteBufAllocator.Default));
            }

            throw new HeliosConnectionException(ExceptionType.NotSupported, string.Format("{0} is an invalid multicast IP address", multicastNode.Host));
        }
Exemplo n.º 2
0
        public void Should_mark_invalid_IPv4_multicast_address_as_invalid()
        {
            //arrange
            var invalidMulticastIp = "255.1.1.1";

            //act
            var isValid = MulticastHelper.IsValidMulticastAddress(IPAddress.Parse(invalidMulticastIp));

            //assert
            Assert.False(isValid);
        }