DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomAssociation Class / Abort Method

The "Cause" of the Abort

The "Cause" of the Abort

Example

In This Topic
    Abort Method
    In This Topic
    Aborts an association
    Syntax
    'Declaration
     
    
    Public Sub Abort( _
       ByVal Reason As System.Byte, _
       ByVal Source As System.Byte _
    ) 
    public void Abort( 
       System.byte Reason,
       System.byte Source
    )

    Parameters

    Reason

    The "Cause" of the Abort

    Source

    The "Cause" of the Abort

    Remarks

    An A-ABORT request is sent, and the association is then terminated.

    The full meanings of the parameters are defined in DICOM Standard part 8, detailed as below:

    Source

    0 - DICOM UL service-user (initiated abort)

    1 - Reserved

    2 - DICOM UL service-provider (initiated abort)

    Reason

    0 - reason-not-specified

    1 - unrecognized-PDU

    2 - unexpected-PDU

    3 - reserved

    4 - unrecognized-PDU parameter

    5 - unexpected-PDU parameter

    6 - invalid-PDU-parameter value

    Example
    using DicomObjects;
    using DicomObjects.DicomUIDs;
                	    
       using (var cn = new DicomAssociation()) 
       {    
           byte reason = 0; // reason-not-specified
           byte source = 0; // DICOM UL service-user (initiated abort)
           
           cn.RequestedContexts.Add(SOPClasses.Verification);
           cn.Open("localhost", 104, "callingAET", "calledAET");        
           cn.Echo();
           
           // cn.Close() is unnecessary here; Abort already closes the association
           cn.Abort(reason, source);
       }
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also