예제 #1
0
        static void Main(string[] args)
        {
            RestServer server = new RestServer(IPAddress.Parse("224.0.0.224"), 53186);

            server.RequestReceived     += new EventHandler <RequestEventArgs <HttpRequest, HttpResponse> >(server_RequestReceived);
            server.HttpRequestReceived += new EventHandler <HttpServerEventArgs>(server_HttpRequestReceived);
            server.StartUdp();
            Console.WriteLine("Server Started");
            //HttpRequest request = new HttpRequest("http://224.0.0.224:53186/Lucene/");
            //request.Protocol = TransportProtocol.UDP;
            //request.GetResponse(false);
            //Thread.Sleep(1000);
            //request = new HttpRequest("http://224.0.0.224:53186/Lucene/");
            //request.Protocol = TransportProtocol.UDP;
            //request.GetResponse(false);
            //Thread.Sleep(10000);
            //request = new HttpRequest("http://224.0.0.224:53186/Lucene/");
            //request.Protocol = TransportProtocol.UDP;
            //request.GetResponse(false);
            //Thread.Sleep(30000);
            //request = new HttpRequest("http://224.0.0.224:53186/Lucene/");
            //request.Protocol = TransportProtocol.UDP;
            //request.GetResponse(false);
            Console.Read();
            server.Stop();
            Console.WriteLine("Server Stopped");
        }