471,356 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Incorrect handling of WebResponse

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
Jul 21 '05 #1
2 1060
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.

Andrew wrote:
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.

Jul 21 '05 #2
And the second probles is gone. In my case call to Abort() of
HttpWebRequest before Close() of WebResponse helped me.

Thanx to all !
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by trialproduct2004 | last post: by
2 posts views Thread by Jeff G. | last post: by
2 posts views Thread by Andrew | last post: by
reply views Thread by archana | last post: by
4 posts views Thread by CindyH | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.