コード例 #1
0
ファイル: App.xaml.cs プロジェクト: mtx33q/virtualrouter
 private void ConnectService()
 {
     if (this._VirtualRouter == null)
     {
         this._VirtualRouter = new VirtualRouterClient.VirtualRouterService.VirtualRouterHostClient();
         this._VirtualRouter.InnerChannel.Faulted += new EventHandler(InnerChannel_Faulted);
         this._VirtualRouter.InnerChannel.Closed += new EventHandler(InnerChannel_Closed);
         this._VirtualRouter.InnerChannel.Opened += new EventHandler(InnerChannel_Opened);
         try
         {
             this._VirtualRouter.Open();
         }
         catch { }
     }
 }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: mtx33q/virtualrouter
        private void ServiceChecker()
        {
            while (true)
            {
                if (this._VirtualRouter.State == System.ServiceModel.CommunicationState.Faulted)
                {
                    this._VirtualRouter = null;
                }

                if (this._VirtualRouter == null)
                {
                    this.ConnectService();
                }

                Thread.Sleep(5000);
            }
        }