Creating an SCP

The following steps provide the basic information required to create an SCP:

image\sqrblit.gif Create the DICOM Network handle by calling L_DicomCreateNet.

image\sqrblit.gif Initialize the DICOM Network handle by calling L_DicomStartUp. This must be done before any DICOM Network Operations functions are called. Please note that this only needs to be called once for each application.

image\sqrblit.gif Call L_DicomSetCallback to set the callback functions you wish to use.

image\sqrblit.gif To listen for incoming connection requests, call L_DicomListen.

image\sqrblit.gif When an SCU wishes to connect to an SCP, the SCU calls L_DicomConnect. This generates a call to the ACCEPTCALLBACK function on the SCP, to let the SCP know that a connection request has been received.

image\sqrblit.gif The SCP should respond by calling L_DicomCreateNet, L_DicomSetCallback and L_DicomAccept. Calling L_DicomCreateNet and L_DicomSetCallback creat a network handle for this specific connection and allows the SCP to maintain information about this connection. Calling L_DicomAccept will generate a call to the CONNECTCALLBACK on the SCU. At this time the DICOM Network connection has been established. (An SCP should always accept a connection request. Once the connection is made the SCP can check the SCU and close the connection if it does not wish to maintain it. Since the connection requests are queued, if the connection is not accepted, it remains in the queue. When the next request is received, it is placed in the queue behind the first request. Calling L_DicomAccept at this point will connect the first request, not the second, since the first request is still in the queue.)

image\sqrblit.gif Establish a security layer. For more information on security layers, refer to Adding Security to a DICOM Connection and Adding TLS Security to a DICOM Connection.

image\sqrblit.gif When an SCU requests a DICOM Associate connection, the SCU calls L_DicomSendAssociateRequest. This generates a call to RECEIVEASSOCIATEREQUESTCALLBACK on the SCP.

image\sqrblit.gif When the RECEIVEASSOCIATEREQUESTCALLBACK function is called, create the DICOM Associate handle by calling L_DicomCreateAssociate.

image\sqrblit.gif Reset the newly created DICOM Associate handle to an Associate Accept by calling L_DicomResetAssociate, or set the new DICOM Associate handle using the following functions:

L_DicomSetRequest

L_DicomSetVersion

L_DicomSetCalled

L_DicomSetCalling

L_DicomSetApplication

L_DicomSetPresentation

L_DicomSetResult

L_DicomSetAbstract

L_DicomSetTransfer

L_DicomSetMaxLength

L_DicomSetImplementClass

L_DicomSetAsyncOperations

L_DicomSetRoleSelect

L_DicomSetImplementVersion

L_DicomSetUserInfo

L_DicomSetExtended

image\sqrblit.gif The DICOM Associate connection request can be accepted or rejected.

To accept the Associate connection request, call L_DicomSendAssociateAccept. This will generate a call to the RECEIVEASSOCIATEACCEPTCALLBACK on the SCU. At this time the DICOM Associate connection has been established.

To reject the Associate connection request, call L_DicomSendAssociateReject. This will generate a call to the RECEIVEASSOCIATEREJECTCALLBACK function on the SCU.