SetHearBeat() public method

public SetHearBeat ( bool bHearBeat ) : void
bHearBeat bool
return void
Ejemplo n.º 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)
     {
     }
 }
Ejemplo n.º 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);
        }