Example #1
0
        public virtual void TestShouldSetMulticastSocketTtl()
        {
            GangliaContext context = new GangliaContext();
            ContextFactory factory = ContextFactory.GetFactory();

            factory.SetAttribute("gangliaContext.multicast", "true");
            factory.SetAttribute("gangliaContext.multicast.ttl", "10");
            context.Init("gangliaContext", factory);
            MulticastSocket multicastSocket = (MulticastSocket)context.datagramSocket;

            Assert.Equal("Did not set TTL", multicastSocket.GetTimeToLive(
                             ), 10);
        }
Example #2
0
        public virtual void TestShouldCreateMulticastSocket()
        {
            GangliaContext context = new GangliaContext();
            ContextFactory factory = ContextFactory.GetFactory();

            factory.SetAttribute("gangliaContext.multicast", "true");
            context.Init("gangliaContext", factory);
            Assert.True("Did not create MulticastSocket", context.datagramSocket
                        is MulticastSocket);
            MulticastSocket multicastSocket = (MulticastSocket)context.datagramSocket;

            Assert.Equal("Did not set default TTL", multicastSocket.GetTimeToLive
                             (), 1);
        }