public static void SendAbort(Association asc, AbortSource abortSource = AbortSource.DICOM_UL_SERV_PROVIDER, AbortReason reason = AbortReason.REASON_NOT_SPECIFIED) { if (asc.Stream.CanWrite) { var abort = new Abort { Source = abortSource, Reason = reason }; var message = abort.Write(); asc.Stream.Write(message, 0, message.Length); } }