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

Socket allocators
[Socket Tools Library]

Collaboration diagram for Socket allocators:

Detailed Description

To help reduce the amount of memory allocation and deallocation that goes on through the life of a client or server we use allocators that pool their allocations and reuse them. This means that once a server is running with a fairly stable maximum number of connections no memory allocation needs to be done on each new connection. The structure of a socket allocator is fairly complex, possibly unecessarilly so. There are currently three different types of allocators, one for each of the socket types supported. Most of the code for these allocators is common and exists in the CSocketAllocator class. There is then a TSocketAllocator template and several interfaces (one for each socket type) and finally a concrete allocation class for each socket type. I'm pretty sure that this class structure could be collapsed a bit by a slighly more aggressive use of templates.


Classes

class  CDatagramServerSocketAllocator
 A socket allocator that allocates datagram server sockets. Note that most of the work is down in CSocketAllocator. More...
class  CDatagramSocketAllocator
 A socket allocator that allocates datagram sockets. Note that most of the work is down in CSocketAllocator. More...
class  IAllocateDatagramServerSockets
 An interface for allocating IPoolableDatagramServerSocket. More...
class  IAllocateDatagramSockets
 An interface for allocating IPoolableDatagramSocket. More...
class  IAllocatePoolableSockets
 An interface for managing IPoolableSocket. More...
class  IAllocateSequencedStreamSockets
 An interface for allocating instances of IPoolableStreamSocket that support sequencing of reads and writes. Before you allocate the first socket you can request that the socket manage buffer sequencing counters for you by requesting a "sequnce id". This id can then be passed to IManageStreamSocketConnectionFilters::ReadCompleted() and IManageStreamSocketConnectionFilters::RequestWrite() calls to have the buffer sequenced using the specified sequnce id. Sockets allocated with this interface automatically support sequencing of the 'primary' byte stream. More...
class  IAllocateStreamSockets
 An interface for allocating instances of IPoolableStreamSocket. More...
class  IMonitorSocketAllocation
 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. More...
class  CSequencedStreamSocketAllocator
 A socket allocator that allocates instances of CSequencedStreamSocket Note that most of the work is down in CSocketAllocator. More...
class  CSocketAllocator
 A base class for socket allocation. There are several different types of socket that are used through the library. Most of the work involved in allocating sockets and managing a pool of sockets is the same for all types. The only things that change are the type of the socket that is being allocated and the way the socket is created. Derived classes provide this functionality. More...
class  CStreamSocketAllocator
 A socket allocator that allocates instances of CStreamSocket. Note that most of the work is down in CSocketAllocator. More...
class  TSocketAllocator
 A template class that provides most of the socket allocation functionality that is shared between all socket types. More...


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