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 | |
CConnectionLimiter & | operator= (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. |
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] |
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.
CConnectionLimiter NoLimitLimiter [static] |
A limiter that has no limit is useful so often that here's one we made earlier.
Used to specify that the connection limiter has no limit to the number of connections that can be created.