Public Member Functions | |
CPendingWriteLimiter (LONG maxPendingWrites) | |
Construct a write limiter that will limit the number of pending writes to maxPendingWrites. Pass NoLimit to create a limiter that doesn't limit. | |
CPendingWriteLimiter (const CPendingWriteLimiter &rhs) | |
~CPendingWriteLimiter () override | |
CPendingWriteLimiter & | operator= (const CPendingWriteLimiter &rhs) |
bool | TryIssueWrite () override |
Called to determine if a write can be issued. Returns true if the write can be issued and false if not. If it returns true then you MUST call WriteCompleted() when the write completes. | |
void | IssueWrite () override |
Called when a write is issued. Blocks until a write can be issued. You MUST call WriteCompleted() when the write completes. | |
void | WriteCompleted () override |
Called when a write has completed or failed if that write was issued after TryIssueWrite() has returned true, or after IssueWrite() has been called. | |
LONG | GetOverallLimit () const override |
Returns the maximum number of pending writes possible; note that this is NOT the current number of writes possible, it's the TOTAL number possible. | |
Static Public Attributes | |
static CPendingWriteLimiter | NoLimitLimiter |
A limiter that has no limit is useful so often that here's one we made earlier. | |
static JETBYTE_CONSTEXPR LONG | NoLimit = 0 |
Used to specify that the write limiter has no limit to the number of connections that can be created. |
CPendingWriteLimiter | ( | LONG | maxPendingWrites | ) | [explicit] |
Construct a write limiter that will limit the number of pending writes to maxPendingWrites. Pass NoLimit to create a limiter that doesn't limit.
CPendingWriteLimiter | ( | const CPendingWriteLimiter & | rhs | ) |
~CPendingWriteLimiter | ( | ) | [override] |
CPendingWriteLimiter& operator= | ( | const CPendingWriteLimiter & | rhs | ) |
bool TryIssueWrite | ( | ) | [override, virtual] |
Called to determine if a write can be issued. Returns true if the write can be issued and false if not. If it returns true then you MUST call WriteCompleted() when the write completes.
Implements ILimitPendingWrites.
void IssueWrite | ( | ) | [override, virtual] |
Called when a write is issued. Blocks until a write can be issued. You MUST call WriteCompleted() when the write completes.
Implements ILimitPendingWrites.
void WriteCompleted | ( | ) | [override, virtual] |
Called when a write has completed or failed if that write was issued after TryIssueWrite() has returned true, or after IssueWrite() has been called.
Implements ILimitPendingWrites.
LONG GetOverallLimit | ( | ) | const [override, virtual] |
Returns the maximum number of pending writes possible; note that this is NOT the current number of writes possible, it's the TOTAL number possible.
Implements ILimitPendingWrites.
CPendingWriteLimiter NoLimitLimiter [static] |
A limiter that has no limit is useful so often that here's one we made earlier.
Used to specify that the write limiter has no limit to the number of connections that can be created.