示例#1
0
        static void Main(string[] args)
        {
            MulticastPolicyConfiguration config = new MulticastPolicyConfiguration();
            config.AnySourceConfiguration.Add("*", new MulticastResource(
              //  IPAddress.Parse("224.0.0.1"), 3000));
              IPAddress.Parse("239.0.0.5"), 45678));
            using (MulticastPolicyServer server = new MulticastPolicyServer(config))
            {
                server.Start();

                Console.Write("Hit enter to exit...");
                Console.ReadLine();

                server.Stop();
            }
        }
        static void Main(string[] args)
        {
            string configFileName = "policyfile.xml";

            if (args.Length>0)
            {
                configFileName = args[0];
            }

            XmlDocument xmlConfigFile = new XmlDocument();
            xmlConfigFile.Load(configFileName);

            MulticastPolicyServer policyServer = new MulticastPolicyServer(
                new MulticastPolicyConfiguration(xmlConfigFile));

            policyServer.Start();

            Console.WriteLine("UDP Policy Server Waiting for Requests");

            Console.ReadLine();

            policyServer.Stop();
        }