Esempio n. 1
0
        static void Main(string[] args)
        {
            //ServiceSettings.InitService("IICCommonlibraryTestr");
            //Rpc_TestAll rpc = new Rpc_TestAll();
            //rpc.MethodTestBatch();
            HttpListenerServer httpServer = new HttpListenerServer("http://127.0.0.1:9097/");

            httpServer.Start();
            Console.ReadLine();
            //
        }
Esempio n. 2
0
 private static void ListenerCallback(IAsyncResult iResult)
 {
     try
     {
         HttpListenerServer  httpServer  = (HttpListenerServer)iResult.AsyncState;
         HttpListenerContext httpContext = httpServer._listener.EndGetContext(iResult);
         Business(httpContext);
         httpServer._listener.BeginGetContext(new AsyncCallback(ListenerCallback), httpServer);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }