public override void Abort()
 {
     if (RequestAbortedSource != null)
     {
         RequestAbortedSource.Cancel();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Immediate kill the connection and poison the request and response streams.
        /// </summary>
        public void Abort()
        {
            if (Interlocked.CompareExchange(ref _requestAborted, 1, 0) == 0)
            {
                _requestProcessingStopping = true;

                _frameStreams?.RequestBody.Abort();
                _frameStreams?.ResponseBody.Abort();

                try
                {
                    ConnectionControl.End(ProduceEndType.SocketDisconnect);
                }
                catch (Exception ex)
                {
                    Log.LogError(0, ex, "Abort");
                }

                try
                {
                    RequestAbortedSource.Cancel();
                }
                catch (Exception ex)
                {
                    Log.LogError(0, ex, "Abort");
                }
                _abortedCts = null;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Immediate kill the connection and poison the request and response streams.
        /// </summary>
        public void Abort()
        {
            _requestProcessingStopping = true;
            _requestAborted            = true;

            _requestBody?.Abort();
            _responseBody?.Abort();

            try
            {
                ConnectionControl.End(ProduceEndType.SocketDisconnect);
                SocketInput.AbortAwaiting();
                RequestAbortedSource.Cancel();
            }
            catch (Exception ex)
            {
                Log.LogError("Abort", ex);
            }
            finally
            {
                _abortedCts = null;
            }
        }
 public void Dispose()
 {
     RequestAbortedSource.Dispose();
 }