public void SendAssociateReject(DicomRejectResult result, DicomRejectSource source, DicomRejectReason reason)
{
if (State != DicomAssociationState.Sta3_AwaitingLocalAAssociationResponsePrimative)
{
Platform.Log(LogLevel.Error, "Error attempting to send association reject at invalid time in association.");
SendAssociateAbort(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified);
throw new DicomNetworkException(
"Attempting to send association reject at invalid time in association, aborting");
}
var pdu = new AAssociateRJ(result, source, reason);
EnqueuePdu(pdu.Write());
State = DicomAssociationState.Sta13_AwaitingTransportConnectionClose;
if (AssociationRejected != null)
AssociationRejected(source, reason);
}