Esempio n. 1
0
        /// <summary>
        /// Called when [network error].
        /// </summary>
        /// <param name="client">The client.</param>
        /// <param name="association">The association.</param>
        /// <param name="e">The e.  Note, e can be null in some instances.</param>
        public void OnNetworkError(DicomClient client, ClientAssociationParameters association, Exception e)
        {
            //TODO: right now this method gets called in timeout and abort situations.  Should add
            // the appropriate methods to the IDicomClientHandler to address this.

            //We don't want to blow away other failure descriptions (e.g. the OnDimseTimeout one).
            if (Status == ScuOperationStatus.Running)
            {
                FailureDescription = String.Format("Unexpected network error: {0}", e == null ? "Unknown" : e.Message);
            }

            if (client.State == DicomAssociationState.Sta13_AwaitingTransportConnectionClose)
            {
                //When this state is set and an error occurs, an appropriate message has already been logged in the client.
            }
            else
            {
                LogAdapter.Logger.Warning(FailureDescription);
            }

            //We don't want to blow away the OnDimseTimeout 'TimeoutExpired' status.
            ScuOperationStatus stopStatus = Status;

            if (stopStatus == ScuOperationStatus.Running)
            {
                stopStatus = ScuOperationStatus.NetworkError;
            }

            ResultStatus = DicomState.Failure;

            StopRunningOperation(stopStatus);
        }
Esempio n. 2
0
 protected void StopRunningOperation(ScuOperationStatus status)
 {
     Status = status;
     ProgressEvent.Set();
 }