The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CPendingWriteLimiter Class Reference

Inheritance diagram for CPendingWriteLimiter:
Collaboration diagram for CPendingWriteLimiter:

List of all members.


Detailed Description

An implementation of ILimitConnections.


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
CPendingWriteLimiteroperator= (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.


Constructor & Destructor Documentation

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 (  )  [override]


Member Function Documentation

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.


Member Data Documentation

A limiter that has no limit is useful so often that here's one we made earlier.

JETBYTE_CONSTEXPR LONG NoLimit = 0 [static, inherited]

Used to specify that the write limiter has no limit to the number of connections that can be created.


Generated on Sun Sep 12 19:09:37 2021 for The Server Framework - v7.4 by doxygen 1.5.3