ClearCanvas.Dicom.Network.NetworkBase.SendAssociateAbort C# (CSharp) Method

SendAssociateAbort() public method

Method to send an association abort PDU.
public SendAssociateAbort ( DicomAbortSource source, DicomAbortReason reason ) : void
source DicomAbortSource The source of the abort.
reason DicomAbortReason The reason for the abort.
return void
        public void SendAssociateAbort(DicomAbortSource source, DicomAbortReason reason)
        {
            if (State != DicomAssociationState.Sta13_AwaitingTransportConnectionClose)
            {
                var pdu = new AAbort(source, reason);

                EnqueuePdu(pdu.Write());
                State = DicomAssociationState.Sta13_AwaitingTransportConnectionClose;


                if (AssociationAborted != null)
                    AssociationAborted(_assoc, reason);
            }
            else
            {
                Platform.Log(LogLevel.Error, "Unexpected state for association abort, closing connection from {0} to {1}",
                                     _assoc.CallingAE, _assoc.CalledAE);

				OnNetworkError(null, true);

                if (NetworkClosed != null)
                    NetworkClosed("Unexpected state for association abort");
            }
        }