Esempio n. 1
0
        public void AddTrackClient(UpDownClient toadd)
        {
            DeletedClient pResult = null;

            if (trackedClientsList_.ContainsKey(toadd.IP))
            {
                pResult = trackedClientsList_[toadd.IP];
                pResult.m_dwInserted = MpdUtilities.GetTickCount();
                for (int i = 0; i != pResult.m_ItemsList.Count; i++)
                {
                    if (pResult.m_ItemsList[i].nPort == toadd.UserPort)
                    {
                        // already tracked, update
                        pResult.m_ItemsList[i].pHash = toadd.Credits;
                        return;
                    }
                }
                PORTANDHASH porthash = new PORTANDHASH(toadd.UserPort, toadd.Credits);
                pResult.m_ItemsList.Add(porthash);
            }
            else
            {
                trackedClientsList_[toadd.IP] = new DeletedClient(toadd);
            }
        }
Esempio n. 2
0
        public DeletedClient(UpDownClient pClient)
        {
            m_cBadRequest = 0;
            m_dwInserted  = MpdUtilities.GetTickCount();
            PORTANDHASH porthash = new PORTANDHASH(pClient.UserPort, pClient.Credits);

            m_ItemsList.Add(porthash);
        }