Public Types | |
typedef CSocketAllocator::SocketCount | SocketCount |
Public Member Functions | |
CStreamSocketAllocator (SocketCount maxFreeSockets, JetByteTools::Socket::PerSocketBufferPoolingLimit maxPooledBuffers, JetByteTools::Socket::ConsecutiveSocketOperations maxConsecutiveOperations, bool log) | |
CStreamSocketAllocator (JetByteTools::Socket::IMonitorSocketAllocation &monitor, SocketCount maxFreeSockets, JetByteTools::Socket::PerSocketBufferPoolingLimit maxPooledBuffers, JetByteTools::Socket::ConsecutiveSocketOperations maxConsecutiveOperations, bool log) | |
CStreamSocketAllocator (const CStreamSocketAllocator &rhs) | |
~CStreamSocketAllocator () | |
CStreamSocketAllocator & | operator= (const CStreamSocketAllocator &rhs) |
IPoolableStreamSocket & | AllocateSocket (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. | |
IPoolableSocket & | AllocatePoolableSocket (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. |
typedef CSocketAllocator::SocketCount SocketCount [inherited] |
Reimplemented from CSocketAllocator.
CStreamSocketAllocator | ( | SocketCount | maxFreeSockets, | |
JetByteTools::Socket::PerSocketBufferPoolingLimit | maxPooledBuffers, | |||
JetByteTools::Socket::ConsecutiveSocketOperations | maxConsecutiveOperations, | |||
bool | log | |||
) |
CStreamSocketAllocator | ( | JetByteTools::Socket::IMonitorSocketAllocation & | monitor, | |
SocketCount | maxFreeSockets, | |||
JetByteTools::Socket::PerSocketBufferPoolingLimit | maxPooledBuffers, | |||
JetByteTools::Socket::ConsecutiveSocketOperations | maxConsecutiveOperations, | |||
bool | log | |||
) |
CStreamSocketAllocator | ( | const CStreamSocketAllocator & | rhs | ) |
CStreamSocketAllocator& operator= | ( | const CStreamSocketAllocator & | rhs | ) |
IPoolableStreamSocket & AllocateSocket | ( | IPoolableSocketManager & | manager, | |
ISocketCallback & | callback, | |||
SOCKET | theSocket | |||
) | [override, inherited] |
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] |
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.
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.