Exemple #1
0
        /// <summary>
        /// Method called on a network error.
        /// </summary>
        /// <param name="e">The exception that caused the network error</param>
        /// <param name="closeConnection">Flag telling if the connection should be closed</param>
        protected override void OnNetworkError(Exception e, bool closeConnection)
        {
            try
            {
                if (_filestreamHandler != null)
                {
                    _filestreamHandler.CancelStream();
                    _filestreamHandler = null;
                }
            }
            catch (Exception x)
            {
                LogAdapter.Logger.Error(x, "Unexpected exception when calling IDicomFilestreamHandler.CancelStream");
            }

            try
            {
                if (_handler != null && State != DicomAssociationState.Sta13_AwaitingTransportConnectionClose)
                {
                    _handler.OnNetworkError(this, _assoc as ServerAssociationParameters, e);
                }
            }
            catch (Exception x)
            {
                LogAdapter.Logger.Error(x, "Unexpected exception when calling IDicomServerHandler.OnNetworkError");
            }

            _closedOnError = true;
            if (closeConnection)
            {
                CloseNetwork(Timeout.Infinite);
            }
        }
Exemple #2
0
        /// <summary>
        /// Method called on a network error.
        /// </summary>
        /// <param name="e">The exception that caused the network error</param>
        /// <param name="closeConnection">Flag telling if the connection should be closed</param>
        protected override void OnNetworkError(Exception e, bool closeConnection)
        {
            try
            {
                if (_handler != null && State != DicomAssociationState.Sta13_AwaitingTransportConnectionClose)
                {
                    _handler.OnNetworkError(this, _assoc as ServerAssociationParameters, e);
                }
            }
            catch (Exception x)
            {
                LogAdapter.Logger.TraceException(x);
            }

            _closedOnError = true;
            if (closeConnection)
            {
                CloseNetwork(Timeout.Infinite);
            }
        }
Exemple #3
0
        /// <summary>
        /// Method called on a network error.
        /// </summary>
        /// <param name="e">The exception that caused the network error</param>
        /// <param name="closeConnection">Flag telling if the connection should be closed</param>
        protected override void OnNetworkError(Exception e, bool closeConnection)
        {
            try
            {
                if (_handler != null && State != DicomAssociationState.Sta13_AwaitingTransportConnectionClose)
                {
                    _handler.OnNetworkError(this, _assoc as ServerAssociationParameters, e);
                }
            }
            catch (Exception x)
            {
                Platform.Log(LogLevel.Error, x, "Unexpected exception when calling IDicomServerHandler.OnNetworkError");
            }

            _closedOnError = true;
            if (closeConnection)
            {
                CloseNetwork(Timeout.Infinite);
            }
        }