private InfoReceiveUser GetUser(string ip)
        {
            InfoReceiveUser user = null;

            foreach (InfoReceiveUser valueUser in listUsers)
            {
                if (valueUser.ip == ip)
                {
                    user = valueUser;
                }
            }
            return(user);
        }
 public void RemoveAnswerUser(string ip)
 {
     lock (listUsers)
     {
         InfoReceiveUser user = GetUser(ip);
         if (user != null)
         {
             user.answerUser = false;
         }
     }
     ClearVideo();
     UpdateStaticComponentVideo();
 }
 public void AddUser(string ip, string name)
 {
     lock (listUsers)
     {
         lock (QueuesUsersPackages)
         {
             InfoReceiveUser user = GetUser(ip);
             if (user == null)
             {
                 listUsers.Add(new InfoReceiveUser(ip, name));
                 QueuesUsersPackages.Add(GetIpInBytes(ip), new Queue <byte[]>());
             }
         }
     }
     ClearVideo();
     UpdateStaticComponentVideo();
 }
 public void RemoveUser(string ip)
 {
     lock (listUsers)
     {
         lock (QueuesUsersPackages)
         {
             InfoReceiveUser user = GetUser(ip);
             if (user != null)
             {
                 QueuesUsersPackages.Remove(GetIpInBytes(ip));
                 listUsers.Remove(user);
             }
         }
     }
     ClearVideo();
     UpdateStaticComponentVideo();
 }