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

TSocketAllocator Class Template Reference
[Socket allocatorsTemplates]

Inheritance diagram for TSocketAllocator:
Collaboration diagram for TSocketAllocator:

List of all members.


Detailed Description

template<typename Base>
class JetByteTools::Socket::TSocketAllocator< Base >

A template class that provides most of the socket allocation functionality that is shared between all socket types.

Public Types

typedef
CSocketAllocator::SocketCount 
SocketCount

Public Member Functions

 TSocketAllocator (SocketCount maxFreeSockets, PerSocketBufferPoolingLimit maxPooledBuffers, ConsecutiveSocketOperations maxConsecutiveOperations)
 TSocketAllocator (IMonitorSocketAllocation &monitor, SocketCount maxFreeSockets, PerSocketBufferPoolingLimit maxPooledBuffers, ConsecutiveSocketOperations maxConsecutiveOperations)
 TSocketAllocator (const TSocketAllocator &rhs)
virtual ~TSocketAllocator ()
TSocketAllocatoroperator= (const TSocketAllocator &rhs)
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


Constructor & Destructor Documentation

TSocketAllocator ( SocketCount  maxFreeSockets,
PerSocketBufferPoolingLimit  maxPooledBuffers,
ConsecutiveSocketOperations  maxConsecutiveOperations 
) [inline]

TSocketAllocator ( IMonitorSocketAllocation monitor,
SocketCount  maxFreeSockets,
PerSocketBufferPoolingLimit  maxPooledBuffers,
ConsecutiveSocketOperations  maxConsecutiveOperations 
) [inline]

TSocketAllocator ( const TSocketAllocator< Base > &  rhs  ) 

virtual ~TSocketAllocator (  )  [virtual]


Member Function Documentation

TSocketAllocator& operator= ( const TSocketAllocator< Base > &  rhs  ) 

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

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]

Implement IProvideUserData.

Reimplemented from CSocketAllocator.

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

Reimplemented from CSocketAllocator.

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

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]

Reimplemented from CSocketAllocator.

bool ReleaseSockets (  )  [inline, override, virtual]

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