Exemple #1
0
 public static IService_SCS_OP GetService()
 {
     try
     {
         string outMsg;
         //////return _RFservice;
         //if (_service == null || _service.GetSSSStatus(out outMsg) == -1)
         if (_service == null)
         {
             _service = CretaeService();
         }
         _service.GetSSSStatus(out outMsg);
         CurrentTryTime = 0;
         return(_service);
     }
     catch (Exception ex)
     {
         _service = null;
         CurrentTryTime++;
         if (CurrentTryTime < MaxTryConnectTimes)
         {
             return(GetService());
         }
         throw new ApplicationException(string.Format("The WCF Connect Closed.{0}", ex.Message));
     }
 }
Exemple #2
0
 public static int GetHostStatus()
 {
     try
     {
         string          outMsg;
         IService_SCS_OP Service = GetService();
         int             sts     = Service.GetSSSStatus(out outMsg);
         return(sts);
     }
     catch (Exception ex)
     {
         return(-1);
     }
 }