DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
Classes | Public Member Functions | Private Member Functions | List of all members
DcmSCPPool< SCP, SCPPool, BaseSCPWorker > Class Template Reference

Implementation of DICOM SCP server pool. More...

+ Inheritance diagram for DcmSCPPool< SCP, SCPPool, BaseSCPWorker >:

Classes

struct  SCPWorker
 Helper class to use any class as an SCPWorker as long as it is a model of the SCP Thread Concept. More...
 

Public Member Functions

 DcmSCPPool ()
 Default construct a DcmSCPPool object.
 
- Public Member Functions inherited from DcmBaseSCPPool
virtual ~DcmBaseSCPPool ()
 Virtual destructor, frees internal memory.
 
virtual void setMaxThreads (const Uint16 maxWorkers)
 Set the number of maximum permitted connections, i.e. threads/workers. More...
 
virtual Uint16 getMaxThreads ()
 Get number of maximum permitted connections, i.e. threads/workers. More...
 
virtual size_t numThreads (const OFBool onlyBusy)
 Get number of currently active connections. More...
 
virtual OFCondition listen ()
 Listen for incoming association requests. More...
 
virtual DcmSCPConfiggetConfig ()
 Return handle to the SCP configuration that is used to configure how to handle incoming associations. More...
 
virtual void stopAfterCurrentAssociations ()
 If enabled, the pool will return from listening for incoming requests as soon as the last worker is idle, i.e. no worker is handling a DICOM association any more.
 

Private Member Functions

virtual BaseSCPWorker * createSCPWorker ()
 Create a worker to be used for handling a request. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DcmBaseSCPPool
 DcmBaseSCPPool ()
 Constructor. More...
 
OFCondition runAssociation (T_ASC_Association *assoc, const DcmSharedSCPConfig &sharedConfig)
 Try to find worker to run the association. More...
 
virtual void dropAndDestroyAssociation (T_ASC_Association *assoc)
 Drops association and clears internal structures to free memory. More...
 
void rejectAssociation (T_ASC_Association *assoc, const T_ASC_RejectParametersReason &reason)
 Reject association using the given reason, e.g. because maximum number of connections is currently already served. More...
 
void notifyThreadExit (DcmBaseSCPWorker *thread, OFCondition result)
 Used by thread to tell pool it has terminated. More...
 

Detailed Description

template<typename SCP = DcmThreadSCP, typename SCPPool = DcmBaseSCPPool, typename BaseSCPWorker = OFTypename SCPPool::DcmBaseSCPWorker>
class DcmSCPPool< SCP, SCPPool, BaseSCPWorker >

Implementation of DICOM SCP server pool.

The pool waits for incoming TCP/IP connection requests, accepts them on TCP/IP level and hands the connection to a worker thread. The maximum number of worker threads, i.e. simultaneous connections, is configurable. The default is 5. At the moment, if no free worker slots are available, an incoming request is rejected with the error "local limit exceeded", i.e. those requests are not queued. This behaviour might change in the future.

Template Parameters
SCPthe service class provider to be instantiated for each request, should follow the SCP Thread Concept.
SCPPoolthe base SCP pool class to use. Use this parameter if you want to use a different implementation (probably derived from DcmBaseSCPPool) as base class for implementing the SCP pool.
BaseSCPWorkerthe base SCP worker class to use. Use this parameter if you want to use a different implementation of the SCP worker, e.g. for using processes instead of threads or sharing a single thread for multiple workers.

Member Function Documentation

◆ createSCPWorker()

template<typename SCP = DcmThreadSCP, typename SCPPool = DcmBaseSCPPool, typename BaseSCPWorker = OFTypename SCPPool::DcmBaseSCPWorker>
virtual BaseSCPWorker* DcmSCPPool< SCP, SCPPool, BaseSCPWorker >::createSCPWorker ( )
inlineprivatevirtual

Create a worker to be used for handling a request.

Returns
a pointer to a newly created SCP worker.

Implements DcmBaseSCPPool.


The documentation for this class was generated from the following file:


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1