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

CStreamSocketAllocator Class Reference
[Stream SocketsSocket allocatorsOpaque user data]

Inheritance diagram for CStreamSocketAllocator:
Collaboration diagram for CStreamSocketAllocator:

List of all members.


Detailed Description

A socket allocator that allocates instances of CStreamSocket. Note that most of the work is down in CSocketAllocator.

Public Types

typedef
CSocketAllocator::SocketCount 
SocketCount

Public Member Functions

 CStreamSocketAllocator (SocketCount maxFreeSockets, PerSocketBufferPoolingLimit maxPooledBuffers, ConsecutiveSocketOperations maxConsecutiveOperations)
 Create an allocator maintains a pool of maxFreeSockets.
 CStreamSocketAllocator (IMonitorSocketAllocation &monitor, SocketCount maxFreeSockets, PerSocketBufferPoolingLimit maxPooledBuffers, ConsecutiveSocketOperations maxConsecutiveOperations)
 Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that maintains a pool of maxFreeSockets.
 CStreamSocketAllocator (const CStreamSocketAllocator &rhs)
CStreamSocketAllocatoroperator= (const CStreamSocketAllocator &rhs)
IPoolableStreamSocketAllocateSocket (IPoolableSocketManager &manager, ISocketCallback &callback, SOCKET theSocket) override
void ReleaseSocket (IPoolableSocket &socket) override
 Release the supplied socket and, either return it to the pool for later reuse or destroy it.
JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex RequestUserDataSlot (const JetByteTools::Core::_tstring &name) override
 Implement IProvideUserData.
JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex LockUserDataSlots () override
DWORD AbortMyConnections (const IPoolableSocketManager &manager, ConnectionClosureReason reason) override
 Walk the list of active connections and abort any that are managed by the supplied manager. Returns the number of active connections that were aborted. Note that the allocator can support more than max(SocketCount) active connections; the size of SocketCount only limits the number of pooled connections.
void DumpMyConnections (const IPoolableSocketManager &manager) const override
bool ReleaseSockets () override
 Forcibly release, and destroy, all active and inactive sockets. Use with care and only in a debugging/system shutdown scenario.

Protected Member Functions

SocketCount EnlargePool (SocketCount socketsToAdd)
 Create socketsToAdd sockets and add them to the pool. Returns the number of sockets now in the pool.
IPoolableSocketAllocatePoolableSocket (IPoolableSocketManager &manager, ISocketCallback &callback, SOCKET theSocket)
 Allocate an instance of IPoolableSocket which has the supplied manager as its manager, the supplied callback interface for callbacks and which is attached to the supplied SOCKET.

Static Protected Attributes

static const SocketCount NoPooledSockets = 0xFFFF
 Pass this value as maxFreeSockets to constructors to create an allocator that doesn't pool sockets at all.

Member Typedef Documentation

Reimplemented from CSocketAllocator.


Constructor & Destructor Documentation

CStreamSocketAllocator ( SocketCount  maxFreeSockets,
PerSocketBufferPoolingLimit  maxPooledBuffers,
ConsecutiveSocketOperations  maxConsecutiveOperations 
)

Create an allocator maintains a pool of maxFreeSockets.

CStreamSocketAllocator ( IMonitorSocketAllocation monitor,
SocketCount  maxFreeSockets,
PerSocketBufferPoolingLimit  maxPooledBuffers,
ConsecutiveSocketOperations  maxConsecutiveOperations 
)

Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that maintains a pool of maxFreeSockets.


Member Function Documentation

CStreamSocketAllocator& operator= ( const CStreamSocketAllocator rhs  ) 

IPoolableStreamSocket & AllocateSocket ( IPoolableSocketManager manager,
ISocketCallback callback,
SOCKET  theSocket 
) [override]

void ReleaseSocket ( IPoolableSocket socket  )  [inline, override, virtual, inherited]

Release the supplied socket and, either return it to the pool for later reuse or destroy it.

Reimplemented from CSocketAllocator.

JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex RequestUserDataSlot ( const JetByteTools::Core::_tstring name  )  [inline, override, virtual, inherited]

Implement IProvideUserData.

Reimplemented from CSocketAllocator.

JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex LockUserDataSlots (  )  [inline, override, virtual, inherited]

Reimplemented from CSocketAllocator.

DWORD AbortMyConnections ( const IPoolableSocketManager manager,
ConnectionClosureReason  reason 
) [inline, override, virtual, inherited]

Walk the list of active connections and abort any that are managed by the supplied manager. Returns the number of active connections that were aborted. Note that the allocator can support more than max(SocketCount) active connections; the size of SocketCount only limits the number of pooled connections.

Reimplemented from CSocketAllocator.

void DumpMyConnections ( const IPoolableSocketManager manager  )  const [inline, override, virtual, inherited]

Reimplemented from CSocketAllocator.

bool ReleaseSockets (  )  [inline, override, virtual, inherited]

Forcibly release, and destroy, all active and inactive sockets. Use with care and only in a debugging/system shutdown scenario.

Reimplemented from CSocketAllocator.

CSocketAllocator::SocketCount EnlargePool ( SocketCount  socketsToAdd  )  [protected, inherited]

Create socketsToAdd sockets and add them to the pool. Returns the number of sockets now in the pool.

IPoolableSocket & AllocatePoolableSocket ( IPoolableSocketManager manager,
ISocketCallback callback,
SOCKET  theSocket 
) [protected, inherited]

Allocate an instance of IPoolableSocket which has the supplied manager as its manager, the supplied callback interface for callbacks and which is attached to the supplied SOCKET.


Member Data Documentation

const CSocketAllocator::SocketCount NoPooledSockets = 0xFFFF [static, inherited]

Pass this value as maxFreeSockets to constructors to create an allocator that doesn't pool sockets at all.


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