SetThrottle() private méthode

private SetThrottle ( Throttle newThrottle ) : void
newThrottle Throttle
Résultat void
Exemple #1
0
 /// <summary>
 /// Adds a new connection to this throttle.
 /// </summary>
 public void Add(Connection con)
 {
     lock (conLock)
     {
         con.SetThrottle(this);
         cons.Add(con);
     }
     if (Active)
     {
         if (ThrottlesDownload)
         {
             AdjustReceiveBuffer();
         }
         if (ThrottlesUpload)
         {
             AdjustSendBuffer();
         }
     }
 }
Exemple #2
0
 public void Remove(int index)
 {
     if (index > -1)
     {
         Connection con = cons[index];
         con.SetThrottle(null);
         cons.RemoveAt(index);
         if (Active)
         {
             if (ThrottlesDownload)
             {
                 ResetReceiveBuffer(con);
             }
             if (ThrottlesUpload)
             {
                 ResetSendBuffer(con);
             }
         }
     }
 }
 /// <summary>
 /// Adds a new connection to this throttle.
 /// </summary>
 public void Add(Connection con)
 {
     lock (conLock)
     {
         con.SetThrottle(this);
         cons.Add(con);
     }
     if (Active)
     {
         if (ThrottlesDownload)
             AdjustReceiveBuffer();
         if (ThrottlesUpload)
             AdjustSendBuffer();
     }
 }