/// <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(); } } }
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(); } }