Beispiel #1
0
        private static void StartRESTApi(Object poObject)
        {
            RESTServerParams loParams = poObject as RESTServerParams;

            mbRESTApiStarted = true;

            using (WebApp.Start <Startup>(url: loParams.ToString()))
            {
                StopServerEvent.Wait();
            }
            mbRESTApiStarted = false;
        }
Beispiel #2
0
 public void StartServer(bool pbStartOnlyLocal, int pnPort)
 {
     if (!mbRESTApiStarted)
     {
         StopServerEvent.Reset();
         var loParameter = new RESTServerParams()
         {
             StartOnlyLocal = pbStartOnlyLocal, Port = pnPort
         };
         this.CurrentServerUrl = loParameter.ToString().Replace("*", Dns.GetHostName());
         ThreadPool.QueueUserWorkItem(new WaitCallback(StartRESTApi), loParameter);
         Thread.Sleep(this.mnWaitTime);
         this.OnServerStateChanged();
         this.BindConnectionEvent();
     }
 }