protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (Content != null) { Content.Close(); Content = null; } if (HttpRequest != null) { // force close connection group //Console.WriteLine(HttpRequest.ConnectionGroupName + "[]" + HttpRequest.ConnectionGroupName.Length.ToString() + "[]" + HttpRequest.ServicePoint.CurrentConnections.ToString()); HttpRequest.ServicePoint.CloseConnectionGroup(HttpRequest.ConnectionGroupName); HttpRequest.Abort(); HttpRequest = null; } _disposed = true; } }
// // Summary: // Forcibly terminates the underlying TCP connection, causing any outstanding I/O // to fail. You might use this method in response to an attack by a malicious HTTP // client. public void Abort() { if (_httpRequest != null) { _httpRequest.Abort(); } else { _httpRequestBase.Abort(); } }
public void Abort() { Request.Abort(); }