protected override void OnBeforeAbort(Connection connection) { // Get the reader from the connection and stop it var reader = connection.GetValue<AsyncStreamReader>(ReaderKey); if (reader != null) { // Stop reading data from the stream reader.StopReading(); // Remove the reader connection.Items.Remove(ReaderKey); } }
protected override void OnBeforeAbort(Connection connection) { // Get the reader from the connection and stop it var reader = connection.GetValue<AsyncStreamReader>(ReaderKey); if (reader != null) { // Stop reading data from the stream, don't close it since we're going to end // the request reader.StopReading(raiseCloseCallback: false); // Remove the reader connection.Items.Remove(ReaderKey); } }