CDatagramServerSocketAllocator Class Reference
[Datagram SocketsSocket allocatorsOpaque user data]

Inheritance diagram for CDatagramServerSocketAllocator:

Inheritance graph
[legend]
Collaboration diagram for CDatagramServerSocketAllocator:

Collaboration graph
[legend]

List of all members.


Detailed Description

A socket allocator that allocates datagram server sockets. Note that most of the work is down in CSocketAllocator.

Public Member Functions

 CDatagramServerSocketAllocator (const SocketCount maxFreeSockets, const DWORD spinCount=0)
 Create an allocator maintains a pool of maxFreeSockets and that initialises the critical sections that are used by each of its sockets with the optional spinCount.
 CDatagramServerSocketAllocator (IMonitorSocketAllocation &monitor, const SocketCount maxFreeSockets, const DWORD spinCount=0)
 Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that maintains a pool of maxFreeSockets. The allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.
 CDatagramServerSocketAllocator (const JetByteTools::Win32::ICriticalSectionFactory &lockFactory, const SocketCount maxFreeSockets)
 Create an allocator which uses the supplied lockFactory to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets.
 CDatagramServerSocketAllocator (IMonitorSocketAllocation &monitor, const JetByteTools::Win32::ICriticalSectionFactory &lockFactory, const SocketCount maxFreeSockets)
 Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that uses the supplied lockFactory to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets.
 CDatagramServerSocketAllocator (const JetByteTools::Win32::ICriticalSectionFactory *pLockFactory, const SocketCount maxFreeSockets, const DWORD spinCount=0)
 Create an allocator which uses the optional lockFactory, if supplied, to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets. If the lockFactory is not provided then the allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.
 CDatagramServerSocketAllocator (IMonitorSocketAllocation &monitor, const JetByteTools::Win32::ICriticalSectionFactory *pLockFactory, const SocketCount maxFreeSockets, const DWORD spinCount=0)
 Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that uses the optional lockFactory, if supplied, to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets. If the lockFactory is not provided then the allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.
virtual
IPoolableDatagramServerSocket
AllocateSocket (IPoolableSocketManager &manager, ISocketCallback &callback, SOCKET theSocket)
virtual void ReleaseSocket (IPoolableSocket &socket)
 Release the supplied socket and, either return it to the pool for later reuse or destroy it.
virtual
JetByteTools::Win32::IIndexedOpaqueUserData::UserDataIndex 
RequestUserDataSlot (const JetByteTools::Win32::_tstring &name)
 Implement IProvideUserData.
virtual
JetByteTools::Win32::IIndexedOpaqueUserData::UserDataIndex 
LockUserDataSlots ()
virtual void AbortMyConnections (const IPoolableSocketManager &manager)
 Walk the list of active connections and abort any that are managed by the supplied manager.
virtual void ReleaseSockets ()
 Forcibly release, and destroy, all active and inactive sockets. Use with care and only in a debugging/system shutdown scenario.

Protected Types

typedef unsigned short SocketCount

Protected Member Functions

SocketCount EnlargePool (const 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.

Member Typedef Documentation

typedef unsigned short SocketCount [inherited]


Constructor & Destructor Documentation

CDatagramServerSocketAllocator ( const SocketCount  maxFreeSockets,
const DWORD  spinCount = 0 
)

Create an allocator maintains a pool of maxFreeSockets and that initialises the critical sections that are used by each of its sockets with the optional spinCount.

CDatagramServerSocketAllocator ( IMonitorSocketAllocation monitor,
const SocketCount  maxFreeSockets,
const DWORD  spinCount = 0 
)

Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that maintains a pool of maxFreeSockets. The allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.

CDatagramServerSocketAllocator ( const JetByteTools::Win32::ICriticalSectionFactory lockFactory,
const SocketCount  maxFreeSockets 
)

Create an allocator which uses the supplied lockFactory to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets.

CDatagramServerSocketAllocator ( IMonitorSocketAllocation monitor,
const JetByteTools::Win32::ICriticalSectionFactory lockFactory,
const SocketCount  maxFreeSockets 
)

Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that uses the supplied lockFactory to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets.

CDatagramServerSocketAllocator ( const JetByteTools::Win32::ICriticalSectionFactory pLockFactory,
const SocketCount  maxFreeSockets,
const DWORD  spinCount = 0 
)

Create an allocator which uses the optional lockFactory, if supplied, to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets. If the lockFactory is not provided then the allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.

CDatagramServerSocketAllocator ( IMonitorSocketAllocation monitor,
const JetByteTools::Win32::ICriticalSectionFactory pLockFactory,
const SocketCount  maxFreeSockets,
const DWORD  spinCount = 0 
)

Create an allocator which can be monitored via the supplied IMonitorSocketAllocation instance and that uses the optional lockFactory, if supplied, to create ICriticalSection instances for its sockets and maintains a pool of maxFreeSockets. If the lockFactory is not provided then the allocator initialises the critical sections that are used by each of its sockets with the optional spinCount.


Member Function Documentation

IPoolableDatagramServerSocket & AllocateSocket ( IPoolableSocketManager manager,
ISocketCallback callback,
SOCKET  theSocket 
) [virtual]

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

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

Reimplemented from CSocketAllocator.

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

Implement IProvideUserData.

Reimplemented from CSocketAllocator.

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

Reimplemented from CSocketAllocator.

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

Walk the list of active connections and abort any that are managed by the supplied manager.

Reimplemented from CSocketAllocator.

void ReleaseSockets (  )  [inline, 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 ( const 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.


Generated on Thu Mar 26 16:39:53 2009 for JetByte Socket Tools - v6.0 by  doxygen 1.5.3