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

CConnectionLimiter Class Reference

Inheritance diagram for CConnectionLimiter:
Collaboration diagram for CConnectionLimiter:

List of all members.


Detailed Description

An implementation of ILimitConnections.


Public Member Functions

 CConnectionLimiter (LONG maxConnections)
 Construct a connection limiter that will limit connections to maxConnections. Pass NoLimit to create a limiter that doesn't limit.
 CConnectionLimiter (const CConnectionLimiter &rhs)
 ~CConnectionLimiter () override
CConnectionLimiteroperator= (const CConnectionLimiter &rhs)
bool CanCreateConnection () override
 Called to determine if a connection can be created. If this returns true then it's assumed that a connection will be created and that when the connection is no longer operational that ReleaseConnection() will be called.
void ReleaseConnection () override
 Called when a connection, that was created after CanCreateConnection() has returned true, is no longer operational.
LONG GetOverallLimit () const override
 Returns the maximum number of connections possible; note that this is NOT the current number of connections possible, it's the TOTAL number possible.

Static Public Attributes

static CConnectionLimiter 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 connection limiter has no limit to the number of connections that can be created.


Constructor & Destructor Documentation

CConnectionLimiter ( LONG  maxConnections  )  [explicit]

Construct a connection limiter that will limit connections to maxConnections. Pass NoLimit to create a limiter that doesn't limit.

CConnectionLimiter ( const CConnectionLimiter rhs  ) 

~CConnectionLimiter (  )  [override]


Member Function Documentation

CConnectionLimiter& operator= ( const CConnectionLimiter rhs  ) 

bool CanCreateConnection (  )  [override, virtual]

Called to determine if a connection can be created. If this returns true then it's assumed that a connection will be created and that when the connection is no longer operational that ReleaseConnection() will be called.

Implements ILimitConnections.

void ReleaseConnection (  )  [override, virtual]

Called when a connection, that was created after CanCreateConnection() has returned true, is no longer operational.

Implements ILimitConnections.

LONG GetOverallLimit (  )  const [override, virtual]

Returns the maximum number of connections possible; note that this is NOT the current number of connections possible, it's the TOTAL number possible.

Implements ILimitConnections.


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 connection limiter has no limit to the number of connections that can be created.


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