DcmSCP Class Reference

Base class for implementing a DICOM Service Class Provider (SCP). More...

List of all members.

Public Member Functions

 DcmSCP ()
 Constructor.
virtual ~DcmSCP ()
 Virtual destructor, frees internal memory.
virtual OFCondition listen ()
 Starts providing the implemented services to SCUs.
virtual OFCondition addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > xferSyntaxes, const T_ASC_SC_ROLE role=ASC_SC_ROLE_DEFAULT, const OFString &profile="DEFAULT")
 Add abstract syntax to presentation contexts the SCP is able to negotiate with SCUs.
void setPort (const Uint16 port)
 Set SCP's TCP/IP listening port.
void setAETitle (const OFString &aetitle)
 Set AETitle of the server.
void setRespondWithCalledAETitle (const OFBool useCalled)
 Set SCP to use the called AETitle from the SCU request for the response, i.e. the SCP will always respond with setting it's own name to the one the SCU used for calling.
virtual OFCondition loadAssociationCfgFile (const OFString &assocFile)
 Loads association configuration file.
virtual OFCondition setAndCheckAssociationProfile (const OFString &profileName)
 If an association profile should be selected, either by loading an associaton configuration file or using the addAbstractSyntax() function, one of those can be selected and checked for validity using this method.
void forceAssociationRefuse (const OFBool doRefuse)
 Force every association request to be refused by SCP, no matter what the SCU is offering.
void setMaxReceivePDULength (const Uint32 maxRecPDU)
 Set maximum PDU size the SCP is able to receive.
OFCondition enableMultiProcessMode (int argc=0, char *argv[]=NULL)
 Enable multi-process mode for SCP.
void setMaxAssociations (const Uint16 maxAssocs)
 Set number of maximum simultanous associations.
void setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode)
 Set whether DIMSE messaging should be blocking or non-blocking.
void setDIMSETimeout (const Uint32 dimseTimeout)
 Set the timeout to be waited for incoming DIMSE message packets.
void setACSETimeout (const Uint32 acseTimeout)
 Set the timeout used during ACSE messaging protocol.
void setVerbosePCMode (const OFBool mode)
 Set whether to show presentation contexts in verbose or debug mode.
Uint16 getPort () const
 Returns TCP/IP port number SCP listens for new connection requests.
const OFStringgetAETitle () const
 Returns SCP's own AE title.
OFBool getRespondWithCalledAETitle () const
 Returns whether SCP uses the called AE Title from SCU requests to respond to connection requests instead of a configured AE Title.
OFBool getRefuseAssociation () const
 Returns whether SCP should refuse any association request no matter what the SCU proposes.
Uint32 getMaxReceivePDULength () const
 Returns maximum PDU length configured to be received by SCP.
OFBool getSingleProcess () const
 Returns whether SCP is running in single or multi-process mode.
Uint16 getMaxAssociations () const
 Returns number of maximum simultanous connections permitted.
T_DIMSE_BlockingMode getDIMSEBlockingMode () const
 Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.
Uint32 getDIMSETimeout () const
 Returns DIMSE timeout (only applicable in blocking mode).
Uint32 getACSETimeout () const
 Returns ACSE timeout.
OFBool getVerbosePCMode () const
 Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.
OFBool isConnected () const
 Returns whether SCP is currently connected.
Uint16 numAssociations () const
 Returns number of associations currently running.
OFString getCalledAETitle () const
 Returns AE Title the SCU used as called AE Title in associaton request.
OFString getPeerAETitle () const
 Returns AE Title (calling AE Title) the SCU used for association request.
OFString getPeerIP () const
 Returns IP address of connected SCU.
Uint32 getPeerMaxPDULength () const
 Returns maximum PDU size the communication peer (i.e. the SCU) is able to receive.

Protected Member Functions

virtual OFCondition handleIncomingCommand (T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presContextInfo)
 Handle incoming command set and react accordingly, e.g. sending response via DIMSE_sendXXXResponse().
virtual void notifyAssociationRequest (const T_ASC_Parameters &params, DcmSCPActionType &desiredAction)
 Overwrite this function to be notified about an incoming association request.
virtual void notifyAssociationAcknowledge ()
 Overwrite this function to be notified about an incoming association request.
virtual void notifyReleaseRequest ()
 Overwrite this function to be notified about an incoming association release request.
virtual void notifyAbortRequest ()
 Overwrite this function to be notified about an incoming association abort request.
virtual void notifyAssociationTermination ()
 Overwrite this function to be notified when an association is terminated.
virtual void notifyDIMSEError (const OFCondition &cond)
 Overwrite this function to be notified when an association is terminated.
virtual OFBool stopAfterCurrentAssociation ()
 Overwrite this function to change the behavior of the listen() method.
virtual OFCondition sendSTOREResponse (T_ASC_PresentationContextID presID, T_DIMSE_C_StoreRQ &reqMessage, T_DIMSE_C_StoreRSP &rspMessage, DcmDataset *statusDetail)
 Respond to storage request.
virtual OFCondition handleECHORequest (T_DIMSE_C_EchoRQ &reqMessage, T_ASC_PresentationContextID presID)
 Standard handler for Verification Service Class (DICOM Echo).
virtual OFCondition handleEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &eventTypeID)
 Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response.
virtual Uint16 checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, DcmDataset *reqDataset)
 Check given N-EVENT-REPORT request and dataset for validity.
virtual OFBool calledAETitleAccepted (const OFString &callingAE, const OFString &calledAE)
 Function that checks for each association request, whether the combination of calling and called AE title proposed by the SCU is accepted.
virtual OFCondition waitForAssociation (T_ASC_Network *network)
 This function takes care of receiving, negotiating and accepting/refusing an association request.
virtual void cleanChildren ()
 This function takes care of removing items referring to (terminated) subprocess from the table which stores all subprocess information.
virtual OFCondition negotiateAssociation ()
 This function checks all presentation contexts proposed by the SCU whether they are supported or not.
virtual void addProcessToTable (int pid)
 This function adds a process to the table that stores process information (only relevant for multi-process mode under Unix-like systems).
virtual void removeProcessFromTable (int pid)
 This function removes one particular item from the table which stores all subprocess information.
virtual void refuseAssociation (DcmRefuseReasonType reason)
 This function takes care of refusing an assocation request.
virtual void handleAssociation ()
 This function takes care of handling the other DICOM application's request.
OFCondition sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DIMSE_ProgressCallback callback, void *callbackContext, DcmDataset **commandSet=NULL)
 Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application.
OFCondition receiveDIMSECommand (T_ASC_PresentationContextID *presID, T_DIMSE_Message *msg, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0)
 Receive DIMSE command (excluding dataset!) over the currently open association.
OFCondition receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject, DIMSE_ProgressCallback callback, void *callbackContext)
 Receives one dataset (of instance data) via network from another DICOM application.

Private Member Functions

 DcmSCP (const DcmSCP &src)
 Private undefined copy constructor.
DcmSCPoperator= (const DcmSCP &src)
 Private undefined assignment operator.
void dropAndDestroyAssociation ()
 Drops association and clears internal structures to free memory.

Private Attributes

T_ASC_Associationm_assoc
 Current association run by this SCP.
DcmAssociationConfigurationm_assocConfig
 Association configuration.
OFString m_assocCfgProfileName
 Profile in association configuration that should be used.
Uint16 m_port
 Port on which the SCP is listening for association requests. The default port is 104.
OFString m_aetitle
 AETitle to be used for responding to SCU (default: DCMTK_SCP).
OFBool m_refuseAssociation
 Indicates if the application shall refuse any association attempt regardless of what the SCU proposes.
Uint32 m_maxReceivePDULength
 Maximum PDU size the SCP is able to receive.
OFBool m_singleProcess
 Indicates if SCP is run in single process mode or not.
OFBool m_forkedChild
 Indicates, that this process was spawn as child from a parent process needed for multiprocess mode under Windows operating systems.
Uint16 m_maxAssociations
 Maximum number of association for multi-process mode.
T_DIMSE_BlockingMode m_blockMode
 Blocking mode for DIMSE operations.
Uint32 m_dimseTimeout
 Timeout for DIMSE operations in seconds.
Uint32 m_acseTimeout
 Timeout for ACSE operations in seconds.
OFBool m_verbosePCMode
 Verbose PC mode.
OFList< DcmProcessSlotType * > m_processTable
 Table of processes for non-single process mode.
OFBool m_respondWithCalledAETitle
 If set, the AE Title as received in the request (called AE Title) is used in response (default: OFTrue).


Detailed Description

Base class for implementing a DICOM Service Class Provider (SCP).

Derived classes can add the presentation contexts they want to support, set further parameters (port, peer hostname, etc. as desired) and then call DcmSCP's listen() method to start the server. For incoming associations and DIMSE messages, a derived class can define the behaviour of the server. The DcmSCP base class is capable of responding to C-ECHO requests (Verification SOP Class).

Warning:
This class is EXPERIMENTAL. Be careful to use it in production environment.

Definition at line 130 of file scp.h.


Constructor & Destructor Documentation

DcmSCP::DcmSCP (  ) 

Constructor.

Initializies internal member variables.

DcmSCP::DcmSCP ( const DcmSCP src  )  [private]

Private undefined copy constructor.

Shall never be called.

Parameters:
src Source object


Member Function Documentation

virtual OFCondition DcmSCP::listen (  )  [virtual]

Starts providing the implemented services to SCUs.

After calling this method the SCP is listening for connection requests.

Returns:
The result. Function usually only returns in case of errors.

virtual OFCondition DcmSCP::addPresentationContext ( const OFString abstractSyntax,
const OFList< OFString xferSyntaxes,
const T_ASC_SC_ROLE  role = ASC_SC_ROLE_DEFAULT,
const OFString profile = "DEFAULT" 
) [virtual]

Add abstract syntax to presentation contexts the SCP is able to negotiate with SCUs.

Parameters:
abstractSyntax [in] The UID of the abstract syntax (e.g. SOP class) to add
xferSyntaxes [in] List of transfer syntaxes (UIDs) that should be supported for the given abstract syntax name
role [in] The role to be negotiated
profile [in] The profile the abstract snytax should be added to. The default is to add it to the DcmSCP's internal standard profile called "DEFAULT".
Returns:
EC_Normal if adding was successful, an error code otherwise

void DcmSCP::setPort ( const Uint16  port  ) 

Set SCP's TCP/IP listening port.

Parameters:
port [in] The port number to listen on. Note that usually on Unix-like systems only root user is permitted to open ports below 1024.

void DcmSCP::setAETitle ( const OFString aetitle  ) 

Set AETitle of the server.

Parameters:
aetitle [in] The AETitle of the server. By default, all SCU association requests calling another AETitle will be rejected. This behaviour can be changed by using the setRespondWithCalledAETitle() method.

void DcmSCP::setRespondWithCalledAETitle ( const OFBool  useCalled  ) 

Set SCP to use the called AETitle from the SCU request for the response, i.e. the SCP will always respond with setting it's own name to the one the SCU used for calling.

Overrides any AETitle eventually set with setAETitle().

Parameters:
useCalled [in] If OFTrue, the SCP will use the called AE title from the request for responding. DcmSCP's default is OFFalse.

virtual OFCondition DcmSCP::loadAssociationCfgFile ( const OFString assocFile  )  [virtual]

Loads association configuration file.

Parameters:
assocFile [in] The filename of the association configuration to be loaded. The association configuration file must be valid for an SCP.
Returns:
EC_Normal if loading was successful, error otherwise

virtual OFCondition DcmSCP::setAndCheckAssociationProfile ( const OFString profileName  )  [virtual]

If an association profile should be selected, either by loading an associaton configuration file or using the addAbstractSyntax() function, one of those can be selected and checked for validity using this method.

Parameters:
profileName [in] The name of the association profile which must be configured before being selected here
Returns:
EC_Normal if selecting/checking was successful, an error code otherwise

void DcmSCP::forceAssociationRefuse ( const OFBool  doRefuse  ) 

Force every association request to be refused by SCP, no matter what the SCU is offering.

Parameters:
doRefuse [in] If OFTrue, every association is being refused. DcmSCP's default is not to refuse every association.

void DcmSCP::setMaxReceivePDULength ( const Uint32  maxRecPDU  ) 

Set maximum PDU size the SCP is able to receive.

This size is sent in associaton response message to SCU.

Parameters:
maxRecPDU [in] The maximum PDU size to use in bytes

OFCondition DcmSCP::enableMultiProcessMode ( int  argc = 0,
char *  argv[] = NULL 
)

Enable multi-process mode for SCP.

For every incoming association, a new process is started. For Unix this is done with the fork() command that creates a copy of the process running and continues executing the code after the fork() called seamlessy. For Windows CreateProcess() is used given the commandline specified in the function's parameters. The created process is handled a copy of the open TCP/IP connection and then is responsible for handling the association. After process fork/creation, DcmSCP is ready for listening to new connection requests.

Parameters:
argc [in] Number of commandline arguments (only Windows)
argv [in] Command line (only Windows)
Returns:
EC_Normal, if single process mode could be enabled, an error otherwise

void DcmSCP::setMaxAssociations ( const Uint16  maxAssocs  ) 

Set number of maximum simultanous associations.

Only works for Unix and with multi-process mode enabled.

Parameters:
maxAssocs [in] Maximum number of simultanous associations

void DcmSCP::setDIMSEBlockingMode ( const T_DIMSE_BlockingMode  blockingMode  ) 

Set whether DIMSE messaging should be blocking or non-blocking.

In non-blocking mode, the networking routines will wait for DIMSE messages for the specified DIMSE timeout time, see setDIMSETimeout() function. In blocking mode, no timeout is set but the operating system's network routines will be used to read from the socket for new data. In the worst case, this may be a long time until that call returns. The default of DcmSCP is blocking mode.

Parameters:
blockingMode [in] Either DIMSE_BLOCKING for blocking mode or DIMSE_NONBLOCKING for non-blocking mode

void DcmSCP::setDIMSETimeout ( const Uint32  dimseTimeout  ) 

Set the timeout to be waited for incoming DIMSE message packets.

This is only relevant for DIMSE blocking mode messaging (see also setDIMSEBlockingMode().

Parameters:
dimseTimeout [in] DIMSE receive timeout in seconds

void DcmSCP::setACSETimeout ( const Uint32  acseTimeout  ) 

Set the timeout used during ACSE messaging protocol.

Parameters:
acseTimeout [in] ACSE timeout in seconds.

void DcmSCP::setVerbosePCMode ( const OFBool  mode  ) 

Set whether to show presentation contexts in verbose or debug mode.

Parameters:
mode [in] Show presentation contexts in verbose mode if OFTrue. By default, the presentation contexts are shown in debug mode.

Uint16 DcmSCP::getPort (  )  const

Returns TCP/IP port number SCP listens for new connection requests.

Returns:
The port number

const OFString& DcmSCP::getAETitle (  )  const

Returns SCP's own AE title.

Only used if the SCP is not configured to respond with the called AE Title the SCU uses for association negotiation, see setRespondWithCalledAETitle().

Returns:
The configured AETitle

OFBool DcmSCP::getRespondWithCalledAETitle (  )  const

Returns whether SCP uses the called AE Title from SCU requests to respond to connection requests instead of a configured AE Title.

Returns:
OFTrue, if the SCU's calling AE Title is utilized, OFFalse otherwise

OFBool DcmSCP::getRefuseAssociation (  )  const

Returns whether SCP should refuse any association request no matter what the SCU proposes.

Returns:
OFTrue, if SCP is configured to refuse every association

Uint32 DcmSCP::getMaxReceivePDULength (  )  const

Returns maximum PDU length configured to be received by SCP.

Returns:
Maximum PDU length in bytes

OFBool DcmSCP::getSingleProcess (  )  const

Returns whether SCP is running in single or multi-process mode.

Returns:
OFTrue, if SCP is running in single process mode, otherwise returns OFFalse

Uint16 DcmSCP::getMaxAssociations (  )  const

Returns number of maximum simultanous connections permitted.

Only makes sense for Unix operating systems. For Windows, the number of maximum connections is either "unlimited" or 1. Use getSingleProcess() in that case to find out if SCP is permitting more than one connection.

Returns:
Under Unix-like systems, returns number of maximum associations (=processes) permitted

T_DIMSE_BlockingMode DcmSCP::getDIMSEBlockingMode (  )  const

Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.

Returns:
DIMSE_BLOCKING if in blocking mode, otherwise DIMSE_NONBLOCKING

Uint32 DcmSCP::getDIMSETimeout (  )  const

Returns DIMSE timeout (only applicable in blocking mode).

Returns:
DIMSE timeout in seconds

Uint32 DcmSCP::getACSETimeout (  )  const

Returns ACSE timeout.

Returns:
ACSE timeout in seconds

OFBool DcmSCP::getVerbosePCMode (  )  const

Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.

The latter is the default.

Returns:
The verbose presentation context mode configured

OFBool DcmSCP::isConnected (  )  const

Returns whether SCP is currently connected.

If in multi-process mode, the "father" process should always return false here, because connection is always handled by child process.

Returns:
OFTrue, if SCP is currently connected to calling SCU

Uint16 DcmSCP::numAssociations (  )  const

Returns number of associations currently running.

Only applicable in Unix-like operating systems. Can only be greater than one when running in multi-process mode.

Returns:
Number of currently running associations

OFString DcmSCP::getCalledAETitle (  )  const

Returns AE Title the SCU used as called AE Title in associaton request.

Returns:
AE Title the SCP was called with. Empty string if SCP is currently not connected.

OFString DcmSCP::getPeerAETitle (  )  const

Returns AE Title (calling AE Title) the SCU used for association request.

Returns:
Calling AE Title of SCU. Empty string if SCP is currently not connected.

OFString DcmSCP::getPeerIP (  )  const

Returns IP address of connected SCU.

Returns:
IP address of connected SCU. Empty string if SCP is currently not connected.

Uint32 DcmSCP::getPeerMaxPDULength (  )  const

Returns maximum PDU size the communication peer (i.e. the SCU) is able to receive.

Returns:
Maximum PDU size the SCU is able to receive. Returns zero if SCP is currently not connected.

virtual OFCondition DcmSCP::handleIncomingCommand ( T_DIMSE_Message incomingMsg,
const DcmPresentationContextInfo presContextInfo 
) [protected, virtual]

Handle incoming command set and react accordingly, e.g. sending response via DIMSE_sendXXXResponse().

The standard handler only knows how to handle an Echo request by calling handleEchoRequest(). This function is most likely to be implemented by a derived class implementing a specific SCP behaviour.

Parameters:
TODO 
Returns:
TODO

virtual void DcmSCP::notifyAssociationRequest ( const T_ASC_Parameters params,
DcmSCPActionType &  desiredAction 
) [protected, virtual]

Overwrite this function to be notified about an incoming association request.

The standard handler only outputs some information to the logger.

Parameters:
TODO 

virtual void DcmSCP::notifyAssociationAcknowledge (  )  [protected, virtual]

Overwrite this function to be notified about an incoming association request.

The standard handler only outputs some information to the logger.

virtual void DcmSCP::notifyReleaseRequest (  )  [protected, virtual]

Overwrite this function to be notified about an incoming association release request.

The standard handler only outputs some information to the logger.

virtual void DcmSCP::notifyAbortRequest (  )  [protected, virtual]

Overwrite this function to be notified about an incoming association abort request.

The standard handler only outputs some information to the logger.

virtual void DcmSCP::notifyAssociationTermination (  )  [protected, virtual]

Overwrite this function to be notified when an association is terminated.

The standard handler only outputs some information to the logger.

virtual void DcmSCP::notifyDIMSEError ( const OFCondition cond  )  [protected, virtual]

Overwrite this function to be notified when an association is terminated.

The standard handler only outputs some information to the logger.

Parameters:
TODO 

virtual OFBool DcmSCP::stopAfterCurrentAssociation (  )  [protected, virtual]

Overwrite this function to change the behavior of the listen() method.

As long as no severe error occurs and this method returns OFFalse, the listen() method will wait for incoming associations in an infinite loop.

Returns:
The standard handler always returns OFFalse

virtual OFCondition DcmSCP::sendSTOREResponse ( T_ASC_PresentationContextID  presID,
T_DIMSE_C_StoreRQ reqMessage,
T_DIMSE_C_StoreRSP rspMessage,
DcmDataset statusDetail 
) [protected, virtual]

Respond to storage request.

Parameters:
presID [in] The presentation context ID to respond to
reqMessage [in] The C-STORE request that is responded to
rspMessage [in] The C-STORE response to be sent
statusDetail [in The status detail to be sent
Returns:
EC_Normal, if responding was successful, an error code otherwise

virtual OFCondition DcmSCP::handleECHORequest ( T_DIMSE_C_EchoRQ reqMessage,
T_ASC_PresentationContextID  presID 
) [protected, virtual]

Standard handler for Verification Service Class (DICOM Echo).

Returns echo response (i.e. whether C-ECHO could be responded to with status success).

Parameters:
reqMessage [in] The C-ECHO request message that was received
presID [in] The presentation context to be used. By default, the presentation context of the request is used.
Returns:
OFCondition value denoting success or error

virtual OFCondition DcmSCP::handleEVENTREPORTRequest ( T_DIMSE_N_EventReportRQ reqMessage,
T_ASC_PresentationContextID  presID,
DcmDataset *&  reqDataset,
Uint16 &  eventTypeID 
) [protected, virtual]

Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response.

Calls checkEVENTREPORTRequest() in order to determine the DIMSE status code to be used for the N-EVENT-REPORT response.

Parameters:
reqMessage [in] The N-EVENT-REPORT request message that was received
presID [in] The presentation context to be used. By default, the presentation context of the request is used.
reqDataset [out] Pointer to the dataset received
eventTypeID [out] Event Type ID from the command set received
Returns:
status, EC_Normal if successful, an error code otherwise

virtual Uint16 DcmSCP::checkEVENTREPORTRequest ( T_DIMSE_N_EventReportRQ reqMessage,
DcmDataset reqDataset 
) [protected, virtual]

Check given N-EVENT-REPORT request and dataset for validity.

This method is called by handleEVENTREPORTRequest() before sending the response in order to determine the DIMSE status code to be used for the response message.

Parameters:
reqMessage [in] The N-EVENT-REPORT request message data structure
reqDataset [in] The N-EVENT-REPORT request dataset received. Might be NULL.
Returns:
DIMSE status code to be used for the N-EVENT-REPORT response. Always returns STATUS_Success (0). Derived classes should, therefore, overwrite this method and return a more appropriate value based on the result of the checks performed.

virtual OFBool DcmSCP::calledAETitleAccepted ( const OFString callingAE,
const OFString calledAE 
) [protected, virtual]

Function that checks for each association request, whether the combination of calling and called AE title proposed by the SCU is accepted.

The standard behaviour is to either accept any AE title (if the corresponding option is set) or to only accept the one set with setAETitle(). In the former case, the function also adopts the SCP's AETitle to the one used by the SCU. The method can be overwritten to have full control about which AE title combinations are accepted by the SCP.

Parameters:
callingAE [in] The AE title the SCU uses as Calling AE Title
calledAE [in] The AE title the SCU uses as Called AE Title
Returns:
OFTrue if the given AE title is going to be accepted, OFFalse otherwise

virtual OFCondition DcmSCP::waitForAssociation ( T_ASC_Network network  )  [protected, virtual]

This function takes care of receiving, negotiating and accepting/refusing an association request.

Additionally, if negotiation was successful, it handles any incoming DIMSE commands by calling handleAssociation(). An error is only returned, if something goes wrong. Therefore, refusing an association because of wrong application context name or no common presentation contexts with the SCU does NOT lead to an error.

Parameters:
network [in] Contains network parameters
Returns:
EC_Normal, if everything went fine, an error code otherwise

virtual void DcmSCP::cleanChildren (  )  [protected, virtual]

This function takes care of removing items referring to (terminated) subprocess from the table which stores all subprocess information.

This function does not make sense for Windows operating systems where the SCP does not have any control over additionally created processes.

virtual OFCondition DcmSCP::negotiateAssociation (  )  [protected, virtual]

This function checks all presentation contexts proposed by the SCU whether they are supported or not.

It is not an error if no common presentation context could be identified with the SCU; only issues like problems in memory management etc. are reported as an error. This function does not send a response message to the SCU. This is done in other functions.

Returns:
EC_Normal if negotiation was successfully done, an error code otherwise

virtual void DcmSCP::addProcessToTable ( int  pid  )  [protected, virtual]

This function adds a process to the table that stores process information (only relevant for multi-process mode under Unix-like systems).

Parameters:
pid [in] The process ID of the sub-process which was just started

virtual void DcmSCP::removeProcessFromTable ( int  pid  )  [protected, virtual]

This function removes one particular item from the table which stores all subprocess information.

The corresponding process item to be deleted will be identified by its process ID. This function is only applicable for multi-process mode under Unix-like systems.

Parameters:
pid [in] Process ID.

virtual void DcmSCP::refuseAssociation ( DcmRefuseReasonType  reason  )  [protected, virtual]

This function takes care of refusing an assocation request.

Parameters:
reason [in] The reason why the association request will be refused and that will be reported to the SCU.

virtual void DcmSCP::handleAssociation (  )  [protected, virtual]

This function takes care of handling the other DICOM application's request.

After having accomplished all necessary steps, the association will be dropped and destroyed.

OFCondition DcmSCP::sendDIMSEMessage ( const T_ASC_PresentationContextID  presID,
T_DIMSE_Message msg,
DcmDataset dataObject,
DIMSE_ProgressCallback  callback,
void *  callbackContext,
DcmDataset **  commandSet = NULL 
) [protected]

Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application.

Parameters:
presID [in] Presentation context ID to be used for message
msg [in] Structure that represents a certain DIMSE command which shall be sent
dataObject [in] The instance data which shall be sent to the other DICOM application; NULL, if there is none
callback [in] Pointer to a function which shall be called to indicate progress
callbackContext [in] Pointer to data which shall be passed to the progress indicating function
commandSet [out] If this parameter is not NULL it will return a copy of the DIMSE command which is sent to the other DICOM application
Returns:
Returns EC_Normal if sending request was successful, an error code otherwise

OFCondition DcmSCP::receiveDIMSECommand ( T_ASC_PresentationContextID *  presID,
T_DIMSE_Message msg,
DcmDataset **  statusDetail,
DcmDataset **  commandSet = NULL,
const Uint32  timeout = 0 
) [protected]

Receive DIMSE command (excluding dataset!) over the currently open association.

Parameters:
presID [out] Contains in the end the ID of the presentation context which was specified in the DIMSE command received
msg [out] The message received
statusDetail [out] If a non-NULL value is passed this variable will in the end contain detailed information with regard to the status information which is captured in the status element (0000,0900). Note that the value for element (0000,0900) is not contained in this return value but in internal msg. For details on the structure of this object, see DICOM standard part 7, annex C).
commandSet [out] If this parameter is not NULL, it will return a copy of the DIMSE command which was received from the other DICOM application. The caller is responsible to de-allocate the returned object!
timeout [in] If this parameter is not 0, it specifies the timeout (in seconds) to be used for receiving the DIMSE command. Otherwise, the default timeout value is used (see setDIMSETimeout()).
Returns:
EC_Normal if command could be received successfully, an error code otherwise

OFCondition DcmSCP::receiveDIMSEDataset ( T_ASC_PresentationContextID *  presID,
DcmDataset **  dataObject,
DIMSE_ProgressCallback  callback,
void *  callbackContext 
) [protected]

Receives one dataset (of instance data) via network from another DICOM application.

Parameters:
presID [out] Contains in the end the ID of the presentation context which was used in the PDVs that were received on the network. If the PDVs show different presentation context IDs, this function will return an error.
dataObject [out] Contains in the end the information which was received over the network
callback [in] Pointer to a function which shall be called to indicate progress
callbackContext [in] Pointer to data which shall be passed to the progress indicating function
Returns:
EC_Normal if dataset could be received successfully, an error code otherwise

DcmSCP& DcmSCP::operator= ( const DcmSCP src  )  [private]

Private undefined assignment operator.

Shall never be called.

Parameters:
src Source object
Returns:
Reference to this


Member Data Documentation

DcmAssociationConfiguration* DcmSCP::m_assocConfig [private]

Association configuration.

May be filled from association configuration file or by adding presentation contexts by calling addPresentationContext() (or both)

Definition at line 640 of file scp.h.

OFString DcmSCP::m_assocCfgProfileName [private]

Profile in association configuration that should be used.

By default, a profile called "DEFAULT" is used.

Definition at line 644 of file scp.h.

OFString DcmSCP::m_aetitle [private]

AETitle to be used for responding to SCU (default: DCMTK_SCP).

This value is not evaluated if the the SCP is configured to respond to any assocation requests with the name the SCU used as Called AE Title (which is the SCP's default behaviour); see setRespondWithCalledAETitle().

Definition at line 653 of file scp.h.

Uint32 DcmSCP::m_maxReceivePDULength [private]

Maximum PDU size the SCP is able to receive.

This value is sent to the SCU during association negotiation.

Definition at line 661 of file scp.h.

OFBool DcmSCP::m_singleProcess [private]

Indicates if SCP is run in single process mode or not.

In multi-process mode, the SCP starts a new process for any incoming association request. The association is then completetly handled by the "child" process while the parent process keeps listening for new associations. Under Unix, multi-process mode uses the fork command to spawn a process which is an exact copy of the parent and continues code execution after the fork command. For Windows, the programmer of the derived class is responsible for setting the command line needed for the internal "CreateProcess" call. The commandline arguments are specified with function enableMultiProcessMode().

Definition at line 671 of file scp.h.

Uint16 DcmSCP::m_maxAssociations [private]

Maximum number of association for multi-process mode.

This member is only evaluated under Unix. For Windows there is no mechanism to restrict the number of simultanous associations in multi-process mode, thus only permitting "unlimited" associations.

Definition at line 688 of file scp.h.

T_DIMSE_BlockingMode DcmSCP::m_blockMode [private]

Blocking mode for DIMSE operations.

If DIMSE non-blocking mode is enabled, the SCP is wating for new DIMSE data a specific (m_dimseTimeout) amount of time and then returns if not data arrives. In blocking mode the SCP is calling the underlying operating system function for receiving data from the socket directly, which may return after a very long time, depending on the system's network configuration.

Definition at line 695 of file scp.h.

Uint32 DcmSCP::m_dimseTimeout [private]

Timeout for DIMSE operations in seconds.

Maximum time in DIMSE non-blocking mode to wait for incoming DIMSE data.

Definition at line 699 of file scp.h.

Uint32 DcmSCP::m_acseTimeout [private]

Timeout for ACSE operations in seconds.

Maximum time during association negotiation which is given for the SCU to follow the ACSE protocol.

Definition at line 703 of file scp.h.

OFBool DcmSCP::m_verbosePCMode [private]

Verbose PC mode.

Flags specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.

Definition at line 707 of file scp.h.

OFList<DcmProcessSlotType *> DcmSCP::m_processTable [private]

Table of processes for non-single process mode.

This member is only applicable when the SCP is running under Unix and multi-process mode.

Definition at line 711 of file scp.h.


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1