ThrottlingListener Class |
Namespace: FastProxy.Listeners
public class ThrottlingListener : DelegatingListener
The ThrottlingListener type exposes the following members.
Name | Description | |
---|---|---|
ThrottlingListener(IListener, Int64) |
Initializes a new ThrottlingListener.
| |
ThrottlingListener(IListener, Int64, Int64) |
Initializes a new ThrottlingListener.
| |
ThrottlingListener(IListener, Int64, Int64, Int32) |
Initializes a new ThrottlingListener.
|
Name | Description | |
---|---|---|
Closed |
Called when the connection has been closed.
(Inherited from DelegatingListener.) | |
DataReceived |
Called when bytes have been received from either the server or the
client.
(Overrides DelegatingListenerDataReceived(Int32, Direction).) | |
Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from DelegatingListener.) | |
Dispose(Boolean) |
Called when the object is being disposed.
(Overrides DelegatingListenerDispose(Boolean).) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
This listener throttles the bandwidth of connections. This is done by delaying forwarding data for a little while if the budget for an interval is exceeded.
The slices parameter to the constructor specifies the number of time interval used to throttle connections. The default value for this parameter is 10. This means that the transfer budget is decided for every 100ms. If in that interval a connection exceeds its allotted budget, this data transfer and all following ones are delayed until a timer configured for the same interval fires.
This listener implements a best effort algorithm to throttle bandwidth usage. It's not exact, and not meant to be. The primary use case is for use in (load) testing applications to e.g. simulate a bad internet connection.