SetHearBeat() public méthode

public SetHearBeat ( bool bHearBeat ) : void
bHearBeat bool
Résultat void
Exemple #1
0
 public void RemoveUserDead()
 {
     try
     {
         if (!lstUsers.InvokeRequired)
         {
             int i;
             for (i = 0; i < _listUsr.Count; i++)
             {
                 User tmp = (User)_listUsr[i];
                 if (tmp.GetIEPConvVideo() == null && tmp.GetIEPConvAudio() == null)
                 {
                     if (!tmp.GetHearBeat())
                     {
                         lstUsers.Items.Remove(tmp.GetUser());
                         _listUsr.Remove(tmp);
                         tmp = null;
                     }
                     else
                     {
                         tmp.SetHearBeat(false);
                     }
                 }
             }
         }
         else
         {
             RemoveUserDeadCallback d = new RemoveUserDeadCallback(RemoveUserDead);
             Invoke(d, new object[] {  });
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #2
0
        public bool HeartBeatUser(String sIP)
        {
            bool bFound = false;

            try
            {
                int i;

                for (i = 0; i < _listUsr.Count && !bFound; i++)
                {
                    User tmp = (User)_listUsr[i];
                    if (tmp.GetIP() == sIP)
                    {
                        tmp.SetHearBeat(true);
                        bFound = true;
                    }
                }
            }
            catch (Exception)
            {
            }
            return(bFound);
        }