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

IMonitorSocketAllocation Class Reference
[InterfacesMonitoringSocket allocatorsProtected destructors on abstract base classes]

Inheritance diagram for IMonitorSocketAllocation:

List of all members.


Detailed Description

An interface to allow a class to monitor the operation of a class that allocates sockets. The design of the interface assumes that sockets go through the following life-cycle: created, allocated, released, destroyed. Allocators that pool sockets can allow a socket to be created once and then allocated and released several times before being deleted. Incrementing a counter when OnSocketCreated() is called and decrementing it when OnSocketDestroyed() is called will give you a count of the number of sockets that are in existence at any one time. A corresponding counter that is incremented in OnSocketAttached() and decremented in OnSocketReleased() is called will give a count of the sockets that are currently in use.

Public Member Functions

virtual void OnSocketCreated ()=0
 Called when a socket is created; a socket can be created only once.
virtual void OnSocketAttached (JetByteTools::Core::IIndexedOpaqueUserData &userData)=0
 Called when a socket is allocated, that is when a connection is initiated. A socket can be allocated multiple times, if, for example, the allocator pools sockets for reuse. Before a given socket can be allocated again it must have been released.
virtual void OnSocketReleased (JetByteTools::Core::IIndexedOpaqueUserData &userData)=0
 Called when a socket is released, that is when a connection no longer requires it and it returns to the allocator. A socket should be released as many times as it is allocated.
virtual void OnSocketDestroyed ()=0
 Called when a socket is destroyed; a socket can be destroyed only once.

Protected Member Functions

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

Constructor & Destructor Documentation

virtual ~IMonitorSocketAllocation (  )  [protected, virtual]

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


Member Function Documentation

virtual void OnSocketCreated (  )  [pure virtual]

Called when a socket is created; a socket can be created only once.

Implemented in CNullSocketAllocationMonitor.

virtual void OnSocketAttached ( JetByteTools::Core::IIndexedOpaqueUserData userData  )  [pure virtual]

Called when a socket is allocated, that is when a connection is initiated. A socket can be allocated multiple times, if, for example, the allocator pools sockets for reuse. Before a given socket can be allocated again it must have been released.

Implemented in CNullSocketAllocationMonitor.

virtual void OnSocketReleased ( JetByteTools::Core::IIndexedOpaqueUserData userData  )  [pure virtual]

Called when a socket is released, that is when a connection no longer requires it and it returns to the allocator. A socket should be released as many times as it is allocated.

Implemented in CNullSocketAllocationMonitor.

virtual void OnSocketDestroyed (  )  [pure virtual]

Called when a socket is destroyed; a socket can be destroyed only once.

Implemented in CNullSocketAllocationMonitor.


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