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

ILimitConnections Class Reference
[InterfacesProtected destructors on abstract base classes]

Inheritance diagram for ILimitConnections:
Collaboration diagram for ILimitConnections:

List of all members.


Detailed Description

An interface to an object that manages the number of connections currently in progress and that can disallow any more connections being made. Call CanCreateConnection() when you wish to create a new connection and if it returns true then you can create your connection and call ReleaseConnection() when the connection terminates. If it returns false then you should not create your connection.

Public Member Functions

virtual bool CanCreateConnection ()=0
 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=0
 Called when a connection, that was created after CanCreateConnection() has returned true, is no longer operational.
virtual LONG GetOverallLimit () const =0
 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
JETBYTE_CONSTEXPR
LONG 
NoLimit = 0
 Used to specify that the connection limiter has no limit to the number of connections that can be created.

Protected Member Functions

 ~ILimitConnections () override
 We never delete instances of this interface; you must manage the lifetime of the class that implements it.

Classes

class  Creator
 A class that takes ownership of an attempt at connection creation. That is if you call CanCreateConnection() through it and then do not call ConnectionCreated() then the destructor will assume something went awry and call ReleaseConnection(). This class can therefore be used to support scope based connection creation. More...

Constructor & Destructor Documentation

~ILimitConnections (  )  [override, protected]

We never delete instances of this interface; you must manage the lifetime of the class that implements it.


Member Function Documentation

virtual bool CanCreateConnection (  )  [pure 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.

Implemented in CConnectionLimiter.

void ReleaseConnection (  )  [override, pure virtual]

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

Implements IReleaseCreatedConnections.

Implemented in CConnectionLimiter.

virtual LONG GetOverallLimit (  )  const [pure 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.

Implemented in CConnectionLimiter.


Member Data Documentation

JETBYTE_CONSTEXPR LONG NoLimit = 0 [static]

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:23 2021 for The Server Framework - v7.4 by doxygen 1.5.3