Example #1
0
 private void doCheckIPLinkStatus()
 {
     if (System.Threading.Interlocked.Exchange(ref syncCheckIP_Point, 1) == 0)
     {
         try
         {
             foreach (KeyValuePair <string, CommuncationInfo> keyPair in dicCommInfo)
             {
                 CommuncationInfo Info = keyPair.Value;
                 if (!SCUtility.isEmpty(Info.Getway_IP))
                 {
                     Info.IsCommunactionSuccess = PingIt(Info.Getway_IP);
                 }
                 if (!SCUtility.isEmpty(Info.Remote_IP))
                 {
                     Info.IsConnectinoSuccess = PingIt(Info.Remote_IP);
                 }
             }
             line.setConnectionInfo(dicCommInfo);
         }
         catch (Exception ex)
         {
             logger.Error(ex, "Exception");
         }
         finally
         {
             System.Threading.Interlocked.Exchange(ref syncCheckIP_Point, 0);
         }
     }
 }