Beispiel #1
0
        /// <summary>
        /// 私有构造
        /// </summary>
        private WcfServer()
        {
            this.services = new List<ServiceHost>();

            //加载配置文件
            WcfServiceSetting config = new WcfServiceSetting();
            this.wcfSetting = config.WcfSetting;
            this.constantSetting = config.ConstantSetting;
        }
Beispiel #2
0
 /// <summary>
 /// 停止服务
 /// </summary>
 public void Stop()
 {
     isStop = true;
     foreach (ServiceHost service in services)
     {
         if (service.State != CommunicationState.Closed)
         {
             service.Close();
         }
     }
     services = null;
     wcfSetting = null;
     constantSetting = null;
     WcfFaultedEvent = null;
     ReleaseInstance();
 }