System.Net.CommandStream.Abort C# (CSharp) Method

Abort() private method

private Abort ( Exception e ) : void
e System.Exception
return void
        internal virtual void Abort(Exception e)
        {
            if (NetEventSource.IsEnabled) NetEventSource.Info(this, "closing control Stream");

            lock (this)
            {
                if (_aborted)
                    return;
                _aborted = true;
            }

            try
            {
                base.Close(0);
            }
            finally
            {
                if (e != null)
                {
                    InvokeRequestCallback(e);
                }
                else
                {
                    InvokeRequestCallback(null);
                }
            }
        }

Usage Example

Beispiel #1
0
        /// <summary>
        ///    <para>Provides a wrapper for the async write operations</para>
        /// </summary>
        private static void WriteCallback(IAsyncResult asyncResult)
        {
            CommandStream connection = (CommandStream)asyncResult.AsyncState;

            try {
                try {
                    connection.EndWrite(asyncResult);
                }
                catch (IOException) {
                    connection.MarkAsRecoverableFailure();
                    throw;
                }
                catch {
                    throw;
                }
                Stream stream = null;
                if (connection.PostSendCommandProcessing(ref stream))
                {
                    return;
                }
                connection.ContinueCommandPipeline();
            } catch (Exception e) {
                connection.Abort(e);
            }
        }
All Usage Examples Of System.Net.CommandStream::Abort