Пример #1
0
 static void Main(string[] args)
 {
     try
     {
         using (var app = new ServiceBaseApplication(args, null))
         using (var server = new WaveServer())
         {
             server.Configure(null);
             server.Start();
             Console.WriteLine("server started...");
             Console.ReadLine();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Critical error:");
         Console.WriteLine(ex);
         Environment.ExitCode = -1;
     }
 }
Пример #2
0
 static void Main(string[] args)
 {
     try
     {
        using(new ServiceBaseApplication(args, null))
      using(var ws = new WaveServer())
      {
         ws.Configure(null);
         ws.Start();
         Console.WriteLine("Web server started. Press <ENTER> to terminate...");
         Console.ReadLine();
      }
     }
     catch(Exception error)
     {
       Console.WriteLine("Exception leaked");
       Console.WriteLine("----------------");
       Console.WriteLine(error.ToMessageWithType());
       System.Environment.ExitCode = -1;
     }
 }
Пример #3
0
 static void Main(string[] args)
 {
     try
     {
         using (var app = new ServiceBaseApplication(args, null))
         using (var server = new WaveServer())
         {
             server.Configure(null);
             server.Start();
             Console.WriteLine("Web server started at {0}.", DateTime.Now);
             Console.WriteLine("Press <ENTER> to terminate...");
             Console.ReadLine();
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Critical error:");
         Console.WriteLine(ex.ToMessageWithType());
         Environment.ExitCode = -1;
     }
 }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (m_Server!=null) return;

             // System.Threading.ThreadPool.SetMaxThreads(1024, 1024);

              m_Server = new WaveServer();
              m_Server.Configure(null);
              try
              {
               // m_Server.Prefixes.Add(tbPrefix.Text);
               // m_Server.KernelHttpQueueLimit = 1;//0000;
               // m_Server.ParallelAccepts = 2;
            m_Server.Start();
              }
              catch
              {
            m_Server.Dispose();
            m_Server = null;
            throw;
              }
        }