How to cancel reading from a Stream obtained using HttpWebResponse.GetResponseStream()?
问题 I use HttpWebResponse.BeginGetResponse() method to make a request to my server. In the "Request Complete" notification I do the following (no error handling code included): HttpWebResponse response = (HttpWebResponse)myHttpWebRequest.EndGetResponse(result); BinaryReader streamReader = new BinaryReader(response.GetResponseStream()); while ((readSize = streamReader.Read(buffer, 0, buffer.Length)) > 0) { ... } My question is if it is OK to store the Stream obtained from response