SetThrottle() private method

private SetThrottle ( Throttle newThrottle ) : void
newThrottle Throttle
return void
Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 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);
             }
         }
     }
 }
Exemplo n.º 3
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();
     }
 }