Beispiel #1
0
        public static void InitHost()
        {
            WcfServer server = WcfServer.GetInstance();

            server.Start();
        }
Beispiel #2
0
 //释放单例
 private void ReleaseInstance()
 {
     if (instance != null)
     {
         lock (lockhelper)
         {
             if (instance != null)
             {
                 instance = null;
             }
         }
     }
 }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            server = WcfServer.GetInstance();

            server.Start();
        }
Beispiel #4
0
        /// <summary>
        /// 获取单例
        /// </summary>
        /// <returns></returns>
        public static WcfServer GetInstance()
        {
            if (instance == null)
            {
                lock (lockhelper)
                {
                    if (instance == null)
                    {
                        instance = new WcfServer();
                    }
                }
            }

            return instance;
        }
Beispiel #5
0
        protected override void OnStart(string[] args)
        {
            server = WcfServer.GetInstance();

            server.Start();
        }