DCMTK
Version 3.6.4
OFFIS DICOM Toolkit
|
Base class for implementing an SCP pool with one thread listening for incoming TCP/IP connections and spawning a number of SCP worker threads that handle the incoming DICOM association on that connection. More...
Classes | |
class | DcmBaseSCPWorker |
Abstract base class that handles forwarding the configuration and T_ASC_Association to the actual worker class for each worker thread. More... | |
Public Member Functions | |
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 DcmSCPConfig & | getConfig () |
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. | |
Protected Member Functions | |
DcmBaseSCPPool () | |
Constructor. More... | |
virtual DcmBaseSCPWorker * | createSCPWorker ()=0 |
Create SCP worker. 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... | |
Private Types | |
enum | runmode { LISTEN, STOP, SHUTDOWN } |
Possible run modes of pool. More... | |
Private Attributes | |
OFMutex | m_criticalSection |
Mutex that guards the list of busy and idle workers. | |
OFList< DcmBaseSCPWorker * > | m_workersBusy |
List of all workers running a connection. | |
OFList< DcmBaseSCPWorker * > | m_workersIdle |
List of all workers being idle, i.e. not running a connection. | |
DcmSCPConfig | m_cfg |
SCP configuration to be used by pool and all workers. | |
Uint16 | m_maxWorkers |
Maximum number of workers that can exist at a time. More... | |
runmode | m_runMode |
Current run mode of pool. | |
Base class for implementing an SCP pool with one thread listening for incoming TCP/IP connections and spawning a number of SCP worker threads that handle the incoming DICOM association on that connection.
This base class is abstract.
|
private |
|
protected |
Constructor.
Initializes internal member variables.
|
protectedpure virtual |
Create SCP worker.
|
protectedvirtual |
Drops association and clears internal structures to free memory.
assoc | The association to free |
|
virtual |
Return handle to the SCP configuration that is used to configure how to handle incoming associations.
For the pool, e.g. by providing settings for TCP connection timeout, and for the workers, e.g. by configuration presentation contexts and the like.
|
virtual |
Get number of maximum permitted connections, i.e. threads/workers.
|
virtual |
Listen for incoming association requests.
For each incoming request, a new thread is started if number of maximum threads is not reached yet.
|
protected |
Used by thread to tell pool it has terminated.
thread | The thread that is calling this function and is about to exit. |
result | The final result of the thread. |
|
virtual |
Get number of currently active connections.
onlyBusy | Return only number of those workers that are busy with a connection and not idle, if OFTrue. |
|
protected |
Reject association using the given reason, e.g. because maximum number of connections is currently already served.
assoc | The association to reject |
reason | The rejection reason |
|
protected |
Try to find worker to run the association.
If worker could be found, a side effect is that assoc is set to NULL.
assoc | The association to be run. Must be not NULL. |
sharedConfig | A DcmSharedSCPConfig object to be used by the worker. |
|
virtual |
Set the number of maximum permitted connections, i.e. threads/workers.
maxWorkers | Number of threads permitted to exist within pool. |
|
private |
Maximum number of workers that can exist at a time.
Thus limits the maximum number of connections for the pool since every worker serves one connection at a time.