Available in LEADTOOLS Medical Imaging toolkits. |
#include "ltdic.h"
L_INT LDicomNet::SendAbort(nSource, nReason)
L_UCHAR nSource; |
/* source of the abort */ |
L_UCHAR nReason; |
/* reason for the abort */ |
Sends an Abort message to a connection. This function is available in the PACS Imaging Toolkit.
Parameter |
Description |
|
nSource |
The source of the abort. Possible values are: |
|
|
Value |
Meaning |
|
PDU_ABORT_SOURCE_USER |
[0] Service user. (SCU) |
|
PDU_ABORT_SOURCE_PROVIDER |
[2] Service provider. (SCP) |
nReason |
The reason for the abort. If the source of the abort is PDU_ABORT_SOURCE_USER, the reasons for the abort are not significant. If the source of the abort is PDU_ABORT_SOURCE_PROVIDER, the possible values are: |
|
|
Value |
Meaning |
|
PDU_ABORT_REASON_UNKNOWN |
[0] Unknown |
|
PDU_ABORT_REASON_UNRECOGNIZED |
[1] Unrecognized PDU |
|
PDU_ABORT_REASON_UNEXPECTED |
[2] Unexpected PDU |
|
PDU_ABORT_REASON_UNRECOGNIZED_PARAM |
[4] Unrecognized PDU parameter |
|
PDU_ABORT_REASON_UNEXPECTED_PARAM |
[5] Unexpected PDU parameter |
|
PDU_ABORT_REASON_INVALID_PARAM |
[6] Invalid PDU parameter value |
Returns
0 |
SUCCESS |
>0 |
An error occurred. Refer to Return Codes. |
Comments
Calling LDicomNet::SendAbort generates a call to LDicomNet::OnReceiveAbort. At this time the DICOM Association is closed.
Please note that it is preferable to close a DICOM Association using the LDicomNet::SendReleaseRequest and LDicomNet::SendReleaseResponse. For more information on closing a DICOM Association, refer to Closing a DICOM Associate Connection.
Required DLLs and Libraries
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
Win32, x64
See Also
Functions: |
LDicomNet::SendReleaseResponse, LDicomNet::SendReleaseRequest |
Topics: |
|
|
|
|
|
|
|
|
Example
#define STATUS_SERVER 0x0001 L_INT LDicomNet__SendAbortExample(LMyDicomNet *m_pDicomNet,L_INT m_nStatus) { //In this example, the m_pDicomNet object sends an abort message to the peer. //The m_pDicomNet can point to an object that is a server or a client // //LMyDicomNet is a class derived from LDicomNet //m_pDicomNet is a member variable declared as: // LMyDicomNet *m_pDicomNet; //m_nStatus is member variable that identifies whether LDicomNet object is a server or client //m_nStatus can be (STATUS_NONE, STATUS_SERVER, STATUS_CLIENT) // int m_nStatus; // // //In this example, assume //1. m_pDicomNet points to a valid object //2. A connection exists between client and server //3. An associate request has been sent and accepted //4. m_nStatus is either STATUS_SERVER or STATUS_CLIENT L_UINT32 lClients; LDicomNet *pDicomNet; L_INT nRet; if (m_nStatus == STATUS_SERVER) { //get the latest client lClients = m_pDicomNet->GetClientCount(); pDicomNet = m_pDicomNet->GetClient(lClients - 1); } else //STATUS_CLIENT { pDicomNet = m_pDicomNet; } //send Abort message nRet =pDicomNet->SendAbort(PDU_ABORT_SOURCE_USER, 0); if(nRet > 0) return nRet; return DICOM_SUCCESS; }