Incorrect handling of WebResponse

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hello all.

Could somebody explain me, why the next three lines of code freeze my
application ? (1.1 Framework)

// ---
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create("http://webcams.lemanonline.net/webcams/tropicsnow/nph-update.cgi?dummy=garb");
WebResponse resp = req.GetResponse();
resp.Close();
// ---

The link produce MJPEG stream.

Some of such link works fine. Some produce WebException with such
description: "The underlying connection was closed: The server committed
an HTTP protocol violation". Some links just freeze my application.


Any ideas how to solve the problem ?

Andrew
 
One of the problems is solved with <httpWebRequest
useUnsafeHeaderParsing="true" />
Now the "The underlying connection was closed: The server committed an
HTTP protocol violation" is gone.

But my application still get freezed with that magic url.
 
And the second probles is gone. In my case call to Abort() of
HttpWebRequest before Close() of WebResponse helped me.

Thanx to all !
 
Back
Top