HttpWebResponse Async The underlying connection was closed : An unexpected error occured on a send
<p>I m using HttpWebRequest class asynchronously as shown in the code below (it's just windows application):</p>

<pre><code>    private void StartWebRequest(string url)
    {           
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.BeginGetResponse(new AsyncCallback(FinishWebRequest), request);          
    }

    private void FinishWebRequest(IAsyncResult result)
    {
            HttpWebResponse response = (result.AsyncState as HttpWebRequest).EndGetResponse(result) as HttpWebResponse;
            Stream responseStream = response.GetResponseStream();
            int num = 100000;
            byte[] buffer = new byte[num];
            int offset = 0;
            while ((num2 = responseStream.Read(buffer, offset, 1000)) != 0)
            {
                offset += num2;
            }
            MemoryStream stream = new MemoryStream(buffer, 0, offset);
            Bitmap bitmap = (Bitmap)Image.FromStream(stream);
            bitmap.Save(@"z:\new.jpg");
            response.Close();

            responseStream.Close();
            stream.Close();

    }
</code></pre>

<p>Sometimes I get that error:</p>

<pre><code>The underlying connection was closed : An unexpected error occured on a send
</code></pre>

<p>Is there anyway to solve this issue?</p>
