Incorrect handling of WebResponse

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
 
A

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.
 
A

Andrew

And the second probles is gone. In my case call to Abort() of
HttpWebRequest before Close() of WebResponse helped me.

Thanx to all !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top